LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
|
This class offers a few tools to work with a modulus m. More...
Public Member Functions | |
Modulus () | |
Modulus (const Int &m) | |
Constructor with modulus of congruence \(m\). | |
Modulus (long b, long e, long c) | |
Constructor with value \(m =b^e + c\). | |
virtual | ~Modulus () |
Destructor. | |
void | init (const Int &m) |
Initializes with value \(m\). | |
void | init (long b, long e, long c) |
Initializes with value \(m =b^e + c\). | |
void | reduceM (const Int &a) |
Reduces the modulus \(m\) and sets the variable mRed to the reduced modulus. | |
bool | perMaxPowPrime (const Int &a) |
Assumes that \(m\) is a power of a prime \(p=b\) and that we have a multiplicative LCG ( \(k = 1\)). |
Public Attributes | |
Int | m |
Value \(m\) of the modulus. | |
Int | mRed |
Reduced value of the modulus, in case m is a power of a prime. | |
bool | primeF |
This flag is true when \(m\) is prime, otherwise false. | |
bool | threeF |
When this flag is true, the value of \(m\) is built out of the three numbers \(b\), \(e\) and \(c\) as described below; otherwise, the flag is set false. | |
long | b |
long | e |
long | c |
When threeF is true, then \(m\) is given in the form \(m = b^e +
c\); otherwise, \(b\), \(e\) and \(c\) are undefined. | |
Int | mRac |
\(\sqrt{\lfloor m \rfloor}\). | |
Int | mRacNeg |
\(-\sqrt{\lfloor m \rfloor}\). |
This class offers a few tools to work with a modulus m.
It keeps the value of m as an Int and its square root. It can also verify the max period conditions and compute the reduced modulus for the lattice structure over a single cycle, when m is a power of a prime. In the latter case, the modulus must be initialized as \(m =b^e + c\).
I am not sure if we should keep this class. It seems that what it contains should be move to where it is used. ********
LatMRG::Modulus< Int >::Modulus | ( | ) |
LatMRG::Modulus< Int >::Modulus | ( | const Int & | m | ) |
Constructor with modulus of congruence \(m\).
LatMRG::Modulus< Int >::Modulus | ( | long | b, |
long | e, | ||
long | c ) |
Constructor with value \(m =b^e + c\).
Restrictions: \(b>1\) and \(e > 0\).
|
virtual |
Destructor.
void LatMRG::Modulus< Int >::init | ( | const Int & | m | ) |
Initializes with value \(m\).
Computes mRac and mRacNeg.
void LatMRG::Modulus< Int >::init | ( | long | b, |
long | e, | ||
long | c ) |
Initializes with value \(m =b^e + c\).
Restrictions: \(b>1\) and \(e > 0\). Computes mRac and mRacNeg.
void LatMRG::Modulus< Int >::reduceM | ( | const Int & | a | ) |
Reduces the modulus \(m\) and sets the variable mRed to the reduced modulus.
The modulus must have the form \(m=p^e\). The multiplier of the LCG is \(a\).
bool LatMRG::Modulus< Int >::perMaxPowPrime | ( | const Int & | a | ) |
Assumes that \(m\) is a power of a prime \(p=b\) and that we have a multiplicative LCG ( \(k = 1\)).
Returns true iff the maximal period conditions are satisfied for this a. For b=2, this holds iff a mod 8 = 3 or 5.
Int LatMRG::Modulus< Int >::m |
Value \(m\) of the modulus.
Int LatMRG::Modulus< Int >::mRed |
Reduced value of the modulus, in case m is a power of a prime.
Computed by reduceM.
bool LatMRG::Modulus< Int >::primeF |
This flag is true when \(m\) is prime, otherwise false.
bool LatMRG::Modulus< Int >::threeF |
When this flag is true, the value of \(m\) is built out of the three numbers \(b\), \(e\) and \(c\) as described below; otherwise, the flag is set false.
long LatMRG::Modulus< Int >::b |
long LatMRG::Modulus< Int >::e |
long LatMRG::Modulus< Int >::c |
When threeF is true, then \(m\) is given in the form \(m = b^e + c\); otherwise, \(b\), \(e\) and \(c\) are undefined.
Int LatMRG::Modulus< Int >::mRac |
\(\sqrt{\lfloor m \rfloor}\).
Int LatMRG::Modulus< Int >::mRacNeg |
\(-\sqrt{\lfloor m \rfloor}\).