LatMRG Online Documentation unknown
Tools to analyze the lattice structure of linear generators
Loading...
Searching...
No Matches
LatMRG::Modulus< Int > Class Template Reference

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}\).

Detailed Description

template<typename Int>
class LatMRG::Modulus< Int >

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. ********

Constructor & Destructor Documentation

◆ Modulus() [1/3]

template<typename Int>
LatMRG::Modulus< Int >::Modulus ( )

◆ Modulus() [2/3]

template<typename Int>
LatMRG::Modulus< Int >::Modulus ( const Int & m)

Constructor with modulus of congruence \(m\).

◆ Modulus() [3/3]

template<typename Int>
LatMRG::Modulus< Int >::Modulus ( long b,
long e,
long c )

Constructor with value \(m =b^e + c\).

Restrictions: \(b>1\) and \(e > 0\).

◆ ~Modulus()

template<typename Int>
LatMRG::Modulus< Int >::~Modulus ( )
virtual

Destructor.

Member Function Documentation

◆ init() [1/2]

template<typename Int>
void LatMRG::Modulus< Int >::init ( const Int & m)

Initializes with value \(m\).

Computes mRac and mRacNeg.

◆ init() [2/2]

template<typename Int>
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.

◆ reduceM()

template<typename Int>
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\).

◆ perMaxPowPrime()

template<typename Int>
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.

Member Data Documentation

◆ m

template<typename Int>
Int LatMRG::Modulus< Int >::m

Value \(m\) of the modulus.

◆ mRed

template<typename Int>
Int LatMRG::Modulus< Int >::mRed

Reduced value of the modulus, in case m is a power of a prime.

Computed by reduceM.

◆ primeF

template<typename Int>
bool LatMRG::Modulus< Int >::primeF

This flag is true when \(m\) is prime, otherwise false.

◆ threeF

template<typename Int>
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.

◆ b

template<typename Int>
long LatMRG::Modulus< Int >::b

◆ e

template<typename Int>
long LatMRG::Modulus< Int >::e

◆ c

template<typename Int>
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.

◆ mRac

template<typename Int>
Int LatMRG::Modulus< Int >::mRac

\(\sqrt{\lfloor m \rfloor}\).

◆ mRacNeg

template<typename Int>
Int LatMRG::Modulus< Int >::mRacNeg

\(-\sqrt{\lfloor m \rfloor}\).


The documentation for this class was generated from the following file: