RiffleArray
Advanced Analysis Library Only
AnalysisLibErrType RiffleArray (double inputArray[], ssize_t numberOfElements, int seed, ssize_t index[]);
Purpose
Riffles an input array of double-precision elements by randomly selecting two elements in inputArray, swapping those elements, and then repeating this process numberOfElements times, where numberOfElements is the size of inputArray.
Example Code
/* The following code riffles the elements in input array x. */
double x[20];
int y[20];
int n = 20;
Uniform (n, 17, x);
RiffleArray (x, n, 3, y);
Parameters
Input | ||
Name | Type | Description |
inputArray | double [] | The input array to riffle. inputArray is overwritten by the riffled array on exit. |
numberOfElements | ssize_t | Number of elements in inputArray. |
seed | int | The seed value at which to riffle inputArray. When seed ≥ 0, RiffleArray generates a new random sequence using the seed value you specify. When seed < 0, RiffleArray generates the sequence as a continuation of the previously generated noise sequence. |
Output | ||
Name | Type | Description |
index | ssize_t [] | The corresponding index in the input array for each element in the riffled array. |
Return Value
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |
Additional Information
Library: Advanced Analysis Library
Include file: analysis.h
LabWindows/CVI compatibility: LabWindows/CVI 2012 and later