Admin Production ni-theme
Current Publication

CxRiffleArray

LabWindows/CVI

CxRiffleArray

Advanced Analysis Library Only

AnalysisLibErrType CxRiffleArray (NIComplexNumber inputArray[], ssize_t numberOfElements, int seed, ssize_t index[]);

Purpose

Riffles the input array of NIComplexNumber 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. */
ComplexNum x[20];
int y[20];
int n = 20, i;
for (i = 0; i < 20; i++) {

x[i].real = i + 0.5;
x[i].imaginary = i - 0.5;

}
CxRiffleArray(x, n, 3, y);

Parameters

Input
Name Type Description
inputArray NIComplexNumber [] 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, CxRiffleArray generates a new random sequence using the seed value you specify.
When seed < 0, CxRiffleArray 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