LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
|
This class offers tools to test the period of an LCG recurrence modulo \(m\), of the form. More...
Public Member Functions | |
LCGComponent (const Int &m, DecompType decomp, const char *filename, bool increment=false) | |
Constructor with modulus \(m\), with the type of prime factor decomposition of \(m-1\) or \(m\) specified by decomp. | |
LCGComponent (const Int &b, int e, const Int &c, DecompType decomp, const char *filename, bool increment=false) | |
Same as the previous constructor, but with m=b^e+c. | |
~LCGComponent () | |
Destructor. | |
void | seta (const Int &a) |
Copy constructor;. | |
Int | geta () const |
Gets the multiplier \(a\) of the recurrence. |
This class offers tools to test the period of an LCG recurrence modulo \(m\), of the form.
\[ x_n = (a x_{n-1} + c_0) \bmod m. \]
The object is constructed for a given value of \(m\) and a boolean that tells if we assume a nonzero increment \(c_0\) relatively prime with \(m\), or no increment ( \(c_0 = 0\)). In the latter case, The same object can be used to test the period for several values of \(a\). It does not look at the lattice structure.
LatMRG::LCGComponent< Int >::LCGComponent | ( | const Int & | m, |
DecompType | decomp, | ||
const char * | filename, | ||
bool | increment = false ) |
Constructor with modulus \(m\), with the type of prime factor decomposition of \(m-1\) or \(m\) specified by decomp.
When increment is false, we consider an LCG with no increment and we need the decomposition of \(m-1\), otherwise we consider an LCG with an increment \(c_0\) relatively prime with \(m\) and we need the prime decomposition of \(m\). The type DecompType is defined in EnumTypes and offers the following choices: DECOMP: the integer will be factored, DECOMP_WRITE: it will be factored and the prime factors written in a file, DECOMP_READ: the prime factors are read from a file, DECOMP_PRIME: the integer is assumed to be prime. The name filename specifies the file where the factors of \(m-1\) or \(m\) are read or written when the type DECOMP_WRITE or DECOMP_READ is used. The given files must be accessible by the program.
LatMRG::LCGComponent< Int >::LCGComponent | ( | const Int & | b, |
int | e, | ||
const Int & | c, | ||
DecompType | decomp, | ||
const char * | filename, | ||
bool | increment = false ) |
Same as the previous constructor, but with m=b^e+c.
LatMRG::LCGComponent< Int >::~LCGComponent | ( | ) |
Destructor.
void LatMRG::LCGComponent< Int >::seta | ( | const Int & | a | ) |
Copy constructor;.
Assignment operator. Sets the multiplier \(a\) of the recurrence to a.
|
inline |
Gets the multiplier \(a\) of the recurrence.