g05yl initializes a quasi-random generator prior to calling g05ym (G05YJF not in this release) (G05YKF not in this release).

# Syntax

C#
```public static void g05yl(
int genid,
int idim,
int[] iref,
int iskip,
out int ifail
)```
Visual Basic
```Public Shared Sub g05yl ( _
genid As Integer, _
idim As Integer, _
iref As Integer(), _
iskip As Integer, _
<OutAttribute> ByRef ifail As Integer _
)```
Visual C++
```public:
static void g05yl(
int genid,
int idim,
array<int>^ iref,
int iskip,
[OutAttribute] int% ifail
)```
F#
```static member g05yl :
genid : int *
idim : int *
iref : int[] *
iskip : int *
ifail : int byref -> unit
```

#### Parameters

genid
Type: System..::..Int32
On entry: must identify the quasi-random generator to use.
${\mathbf{genid}}=1$
Sobol generator.
${\mathbf{genid}}=2$
Sobol (A659) generator.
${\mathbf{genid}}=3$
Niederreiter generator.
${\mathbf{genid}}=4$
Faure generator.
Constraint: ${\mathbf{genid}}=1$, $2$, $3$ or $4$.
idim
Type: System..::..Int32
On entry: the number of dimensions required.
Constraints:
• if ${\mathbf{genid}}=1$, $1\le {\mathbf{idim}}\le 10000$;
• if ${\mathbf{genid}}=2$, $1\le {\mathbf{idim}}\le 1111$;
• if ${\mathbf{genid}}=3$, $1\le {\mathbf{idim}}\le 318$;
• if ${\mathbf{genid}}=4$, $1\le {\mathbf{idim}}\le 40$.
iref
Type: array<System..::..Int32>[]()[][]
An array of size [liref]
On exit: contains initialization information for use by the generator methods (G05YJF not in this release) (G05YKF not in this release) g05ym. iref must not be altered in any way between initialization and calls of the generator methods.
iskip
Type: System..::..Int32
On entry: the number of terms of the sequence to skip on initialization for the Sobol and Niederreiter generators. If ${\mathbf{genid}}=4$, iskip is ignored.
Constraint: if ${\mathbf{genid}}=1$, $2$ or $3$, $0\le {\mathbf{iskip}}\le {2}^{30}$.
ifail
Type: System..::..Int32%
On exit: ${\mathbf{ifail}}={0}$ unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

# Description

g05yl selects a quasi-random number generator through the input value of genid and initializes the iref communication array for use by the methods g05ym (G05YJF not in this release) (G05YKF not in this release).
One of three types of quasi-random generator may be chosen, allowing the low-discrepancy sequences proposed by Sobol, Faure or Niederreiter to be generated.
Two sets of Sobol sequences are supplied, the first, is based on the work of Joe and Kuo (2008). The second, referred to in the documentation as "Sobol (A659)", is based on Algorithm 659 of Bratley and Fox (1988) with the extension to 1111 dimensions proposed by Joe and Kuo (2003). Both sets of Sobol sequences should satisfy the so-called Property A, up to $1111$ dimensions, but the first set should have better two-dimensional projections than those produced using Algorithm 659.

# References

Bratley P and Fox B L (1988) Algorithm 659: implementing Sobol's quasirandom sequence generator ACM Trans. Math. Software 14(1) 88–100
Fox B L (1986) Algorithm 647: implementation and relative efficiency of quasirandom sequence generators ACM Trans. Math. Software 12(4) 362–376
Joe S and Kuo F Y (2003) Remark on Algorithm 659: implementing Sobol's quasirandom sequence generator ACM Trans. Math. Software (TOMS) 29 49–57
Joe S and Kuo F Y (2008) Constructing Sobol sequences with better two-dimensional projections SIAM J. Sci. Comput. 30 2635–2654

# Error Indicators and Warnings

Errors or warnings detected by the method:
${\mathbf{ifail}}=1$
 On entry, ${\mathbf{genid}}<1$, or ${\mathbf{genid}}>4$.
${\mathbf{ifail}}=2$
 On entry, ${\mathbf{idim}}<1$, or idim is too large.
${\mathbf{ifail}}=4$
On entry, liref is too small.
${\mathbf{ifail}}=5$
The value of ${\mathbf{iskip}}<0$ or iskip is too large.
${\mathbf{ifail}}=-9000$
An error occured, see message report.
${\mathbf{ifail}}=-8000$
Negative dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$

Not applicable.

None.

# Further Comments

The primitive polynomials and direction numbers used for the Sobol generator (${\mathbf{genid}}=1$) were calculated by Joe and Kuo (2008) using the search critera ${D}^{\left(6\right)}$.