Class MersenneTwisterParamSearcher
- java.lang.Object
-
- dev.nm.stat.random.rng.univariate.uniform.mersennetwister.dynamiccreation.MersenneTwisterParamSearcher
-
public class MersenneTwisterParamSearcher extends Object
Searches for Mersenne-Twister parameters.
-
-
Field Summary
Fields Modifier and Type Field Description static MersenneExponent
DEFAULT_MERSENNE_EXPONENT
-
Constructor Summary
Constructors Constructor Description MersenneTwisterParamSearcher(RandomLongGenerator rng)
Constructs a new instance which uses the given RNG to do the parameter search.MersenneTwisterParamSearcher(RandomLongGenerator rng, MersenneExponent p)
Constructs a new instance which uses the given RNG to do the parameter search, with the given period parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MersenneTwisterParam
search()
Performs a search for parameters with no id.MersenneTwisterParam
search(int id)
Performs a search for parameters for a given id.
-
-
-
Field Detail
-
DEFAULT_MERSENNE_EXPONENT
public static final MersenneExponent DEFAULT_MERSENNE_EXPONENT
-
-
Constructor Detail
-
MersenneTwisterParamSearcher
public MersenneTwisterParamSearcher(RandomLongGenerator rng)
Constructs a new instance which uses the given RNG to do the parameter search.DEFAULT_MERSENNE_EXPONENT
is used.- Parameters:
rng
- the random number generator to use for the search
-
MersenneTwisterParamSearcher
public MersenneTwisterParamSearcher(RandomLongGenerator rng, MersenneExponent p)
Constructs a new instance which uses the given RNG to do the parameter search, with the given period parameter. The actual period of the RNG will be 2^p, where p is the given period parameter. Note that choosing a greater period rapidly increases the cost of running the algorithm and the smallest period should suffice for all but the most demanding application.- Parameters:
rng
- the random number generator to use for the searchp
- the period parameter
-
-
Method Detail
-
search
public MersenneTwisterParam search(int id) throws DynamicCreatorException
Performs a search for parameters for a given id.- Parameters:
id
- the id- Returns:
- the found parameters
- Throws:
DynamicCreatorException
- if the search failed
-
search
public MersenneTwisterParam search() throws DynamicCreatorException
Performs a search for parameters with no id.- Returns:
- the found parameters
- Throws:
DynamicCreatorException
- if the search for parameters has failed
-
-