LDSequences
A collection of C++ classes for the generation of low-discrepancy
sequences
What are low-discrepancy sequences
Yet to come... sorry.
How can I use them in my program?
Well, it's very simple:
-
-) Include the necessary include files in your code
-
-) create an object of the according child class of LDSqBase. Note that
this is the only place where you tell the program which sequence you want
to create. The code to create the elements of the sequence does not have
to be changed if you want to use a different sequence.
// Giving NULL for the bases, means: use the first dim prime numbers
long dim=7;
LDSqBase*Numbers=(LDSqBase*)new Halton(NULL, dim);
-) Once the object is created, you can easily get the next or the n-th
element of the sequence. The following line gives the next element of the
sequence (the sequence remembers the index of the element it returned
last time). // if lenght (here 12) is larger than dim used to create the
sequence, the rest of the dimensions is filled with pseudo-random numbers
created by the ran2 method described in "Numerical Recipies in C".
double buffer[13];
Numbers->NextElement(&buffer[0], 12);
Or if you want to get e.g. th 16234-th element of the sequence, give that
index as additional argument:
Numbers->NextElement(&buffer[0], 12, 16234);
-) When you don't need the sequence any more, release / delete it:
delete Numbers;
-) Make sure you compile the *.cpp files from the LDSequences package and
link your program to the object files, too!!!
List of the classes included
The complete reference of all classes and
their methods included is provided here (automatically
created from the sources and the comments there by Doxygen).
I also created a small Mathematica package to create the Halton/Van
der Corput, Faure and Niederreiter sequences in Mathematica. The notebook
LDSequences.nb with the code and the respective package LDSequences.m can
be found in CVS in the module "Mathematica".
How to get the classes
Look at the LDSequences'
development homepage at sourceforge. You can either download a release
version (once version 1.0 is ready) or use cvs to get a development snapshot
as described at that page.
Yet to come... sorry.
I want to help
If you feel this is an important project for the scientific community,
I really invite you to join forces with me and help develop or maintain
these classes. Contact me at my email address reinhold@kainhofer.com.
License
This software is free software; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
For the complete text of the license see the GPL-web
page.
Reinhold Kainhofer, email: reinhold@kainhofer.com,
homepage: http://reinhold.kainhofer.com
This page is hosted by Sourceforge
,
which provide a lot of free services for Open Source projects.