sampler#
Structs#
Sampler#
Uniform#
Sobol#
Halton#
Functions#
i8_bit_lo0#
-
inline int ioh::common::random::sampler::i8_bit_lo0(long long int n)#
Purpose:
I8_BIT_LO0 returns the position of the low 0 bit base 2 in an integer.
Example:
0 0 1 1 1 2 2 10 1 3 11 3 4 100 1 5 101 2 6 110 1 7 111 4 8 1000 1 9 1001 2 10 1010 1 11 1011 3 12 1100 1 13 1101 2 14 1110 1 15 1111 5 16 10000 1 17 10001 2 1023 1111111111 11 1024 10000000000 1 1025 10000000001 2N Binary Lo 0
Licensing:
This code is distributed under the GNU LGPL license.
Modified:
12 May 2007
Author:
John Burkardt
Parameters:
Input, long long int N, the integer to be measured. N should be nonnegative.
Output, int I8_BIT_LO0, the position of the low 1 bit.
i8_sobol#
-
inline void ioh::common::random::sampler::i8_sobol(int dim_num, long long int *seed, double quasi[], double lb = 0, double ub = 1)#
Purpose:
I8_SOBOL generates a new quasirandom Sobol vector with each call.
Discussion:
The routine adapts the ideas of Antonov and Saleev.
This routine uses LONG LONG INT for integers and DOUBLE for real values.
Thanks to Steffan Berridge for supplying (twice) the properly formatted V data needed to extend the original routine’s dimension limit from 40 to 1111, 05 June 2007.
Thanks to Francis Dalaudier for pointing out that the range of allowed values of DIM_NUM should start at 1, not 2! 17 February 2009.
Licensing:
This code is distributed under the GNU LGPL license.
Modified:
17 February 2009
Author:
FORTRAN77 original version by Bennett Fox. C++ version by John Burkardt
Reference:
IA Antonov, VM Saleev, An Economic Method of Computing LP Tau-Sequences, USSR Computational Mathematics and Mathematical Physics, Volume 19, 1980, pages 252 - 256.
Paul Bratley, Bennett Fox, Algorithm 659: Implementing Sobol’s Quasirandom Sequence Generator, ACM Transactions on Mathematical Software, Volume 14, Number 1, pages 88-100, 1988.
Bennett Fox, Algorithm 647: Implementation and Relative Efficiency of Quasirandom Sequence Generators, ACM Transactions on Mathematical Software, Volume 12, Number 4, pages 362-376, 1986.
Stephen Joe, Frances Kuo Remark on Algorithm 659: Implementing Sobol’s Quasirandom Sequence Generator, ACM Transactions on Mathematical Software, Volume 29, Number 1, pages 49-57, March 2003.
Ilya Sobol, USSR Computational Mathematics and Mathematical Physics, Volume 16, pages 236-242, 1977.
Ilya Sobol, YL Levitan, The Production of Points Uniformly Distributed in a Multidimensional Cube (in Russian), Preprint IPM Akad. Nauk SSSR, Number 40, Moscow 1976.
Parameters:
Input, int DIM_NUM, the number of spatial dimensions. DIM_NUM must satisfy 1 <= DIM_NUM <= 1111.
Input/output, long long int *SEED, the “seed” for the sequence. This is essentially the index in the sequence of the quasirandom value to be generated. On output, SEED has been set to the appropriate next value, usually simply SEED+1. If SEED is less than 0 on input, it is treated as though it were 0. An input value of 0 requests the first (0-th) element of the sequence.
Output, double QUASI[DIM_NUM], the next quasirandom vector.