![]() |
|
|||
File indexing completed on 2025-02-21 10:15:33
0001 //! \file ranlux.h 0002 0003 #ifndef __RANLUX_H__ 0004 #define __RANLUX_H__ 0005 0006 /* This is a lagged fibonacci generator with skipping developed by Luescher. 0007 The sequence is a series of 24-bit integers, x_n, 0008 0009 x_n = d_n + b_n 0010 0011 where d_n = x_{n-10} - x_{n-24} - c_{n-1}, b_n = 0 if d_n >= 0 and 0012 b_n = 2^24 if d_n < 0, c_n = 0 if d_n >= 0 and c_n = 1 if d_n < 0, 0013 where after 24 samples a group of p integers are "skipped", to 0014 reduce correlations. By default p = 199, but can be increased to 0015 365. 0016 0017 The period of the generator is around 10^171. 0018 0019 From: M. Luescher, "A portable high-quality random number generator 0020 for lattice field theory calculations", Computer Physics 0021 Communications, 79 (1994) 100-110. 0022 0023 Available on the net as hep-lat/9309020 at http://xxx.lanl.gov/ 0024 0025 See also, 0026 0027 F. James, "RANLUX: A Fortran implementation of the high-quality 0028 pseudo-random number generator of Luscher", Computer Physics 0029 Communications, 79 (1994) 111-114 0030 0031 Kenneth G. Hamilton, F. James, "Acceleration of RANLUX", Computer 0032 Physics Communications, 101 (1997) 241-248 0033 0034 Kenneth G. Hamilton, "Assembler RANLUX for PCs", Computer Physics 0035 Communications, 101 (1997) 249-253 */ 0036 0037 namespace siscone{ 0038 0039 /// initialize 'ranlux' generator 0040 void ranlux_init(); 0041 0042 /// generate random value (24 bits) 0043 unsigned long int ranlux_get(); 0044 0045 /// save state of the generator 0046 void ranlux_print_state(); 0047 0048 } 0049 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |