G05YLF (PDF version)
G05 Chapter Contents
G05 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

G05YLF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

G05YLF initializes a quasi-random generator prior to calling G05YJF, G05YKF or G05YMF.

2  Specification

SUBROUTINE G05YLF ( GENID, IDIM, IREF, LIREF, ISKIP, IFAIL)
INTEGER  GENID, IDIM, IREF(LIREF), LIREF, ISKIP, IFAIL

3  Description

G05YLF selects a quasi-random number generator through the input value of GENID and initializes the IREF communication array for use by the routines G05YJF, G05YKF or G05YMF.
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.

4  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

5  Parameters

1:     GENID – INTEGERInput
On entry: must identify the quasi-random generator to use.
GENID=1
Sobol generator.
GENID=2
Sobol (A659) generator.
GENID=3
Niederreiter generator.
GENID=4
Faure generator.
Constraint: GENID=1, 2, 3 or 4.
2:     IDIM – INTEGERInput
On entry: the number of dimensions required.
Constraints:
  • if GENID=1, 1IDIM10000;
  • if GENID=2, 1IDIM1111;
  • if GENID=3, 1IDIM318;
  • if GENID=4, 1IDIM40.
3:     IREFLIREF – INTEGER arrayCommunication Array
On exit: contains initialization information for use by the generator routines G05YJF, G05YKF and G05YMF. IREF must not be altered in any way between initialization and calls of the generator routines.
4:     LIREF – INTEGERInput
On entry: the dimension of the array IREF as declared in the (sub)program from which G05YLF is called.
Constraints:
  • if GENID=1, 2 or 3, LIREF32×IDIM+7;
  • if GENID=4, LIREF407.
5:     ISKIP – INTEGERInput
On entry: the number of terms of the sequence to skip on initialization for the Sobol and Niederreiter generators. If GENID=4, ISKIP is ignored.
Constraint: if GENID=1, 2 or 3, 0ISKIP230.
6:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
On entry, GENID=value.
Constraint: GENID=1, 2, 3 or 4.
IFAIL=2
On entry, IDIM=value.
Constraint: 1IDIMvalue.
IFAIL=4
On entry, LIREF is too small: LIREF=value, minimum length is value.
IFAIL=5
On entry, ISKIP<0 or ISKIP is too large: ISKIP=value, maximum value is value.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

G05YLF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

The primitive polynomials and direction numbers used for the Sobol generator (GENID=1) were calculated by Joe and Kuo (2008) using the search critera D6.

10  Example

See Section 10 in G05YMF.

G05YLF (PDF version)
G05 Chapter Contents
G05 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015