RNGTS Examples
Description of examples
all these examples can be found in the ${HOMEDIR}/example directory
- bit_extract_example
This is an example for the Bit
extract test in section 4.7. In the first part, the lower 10
bits
are used to build a new random number, in the second part, bit number
20
of 10 random numbers is used to build a new random number.
- bit_test_example
This is an example for the Bit test
in section 4.6. A mask of a length of 30 bits is used to produce new
random numbers.
- count_failings_example
This is an example for the Count
failings test in section 4.5. A test is run 1000 times and it
passes if it fails less than 100 times.
- diehard
This example simulates Marsaglias Diehard test suite which is
available at http://www.stat.fsu.edu/~geo/
or for a newer version at http://www.csis.hku.hk/~diehard/
- doc_example
This is the example from the documentation in section 4.1.
- foreign_rng_example
This is an example of using a foreign random number generator as
described in section 6.5. The used random number generator is the
original C version of the Mersenne Twister which can be downloaded at http://www.math.sci.hiroshima-u.ac.jp/%7Em-mat/MT/VERSIONS/C-LANG/991029/mt19937-1.c.
More detailed instructions are written in the source file.
- helsinki
This is the same compilation as used in the Comparative study of some
pseudorandom number generators , [30], excepting the runs test.
- iterating_example
This is an example for the possibility of iterating tests as described
in section 4.4. Each test is iterated 1000 times and analysed.
- iterator_seed_example
This example shows how to seed a random number generator with
iterators. Here, Boost s Mersenne Twister is seeded with a vector
filled
by a linear congruential generator.
- parallel_example This
example shows how a simple parallel generator may be constructed and
its
usage. A parallel generator of two different seeded Lagged Fibonacci
generators is used.
- all_tests_example In
this example all currently available tests are included.
Results
The following table lists the results of the tests above. If you don't
have a xml ready browser you
can select the html file to
get
approximately the same view.
Note
The output in the table is created with the following statements
- xml
created by running the example
- html
created with the xsltproc and
the xml2html.xsl stylesheet
> xsltproc xml2html.xsl input.xml > output.html
- PostScript
created with the xsltproc
and the xml2LaTeX.xsl
stylesheet, LaTeX and dvips
> xsltproc
xml2LaTeX.xsl input.xml > output.tex
run LaTeX twice to
get correct references
> latex output.tex
> latex output.tex
> dvips -Ppdf
-G0 output.dvi -o output.ps