HaltonSeq
Advanced Analysis Library Only
AnalysisLibErrType HaltonSeq (ssize_t numberOfElements, int seed, int initialize, double haltonSequence[]);
Purpose
Generates an array containing a quasi-random Halton sequence, which is a low-discrepancy number sequence that uniformly distributes in the interval [0, 1].
Example Code
/* The following code generates an array containing a Halton sequence. */
double x[20];
int n;
n = 20;
HaltonSeq (n, 17, TRUE, x);
Parameters
Input | ||
Name | Type | Description |
numberOfElements | ssize_t | The number of elements to generate in the Halton sequence. |
seed | int | The seed value used to generate the random number. seed must be a prime number. If seed is negative, this function takes the absolute value. |
initialize | int | Specifies whether to reseed the sequence generator. Specify a nonzero value or select Yes in the function panel to initialize the sequence generator according to the value of seed. Specify 0 or select No in the function panel to resume producing the sequence as a continuation of the previously generated sequence. |
Output | ||
Name | Type | Description |
haltonSequence | double [] | An output array containing the generated Halton sequence in the interval [0,1]. |
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