LatMRG Guide
1.0
A software package to test and search for new linear congruential random number generators
|
This class represents a combined MRG. More...
#include <latmrg/ComboLattice.h>
Public Types | |
typedef Dbl | Float |
typedef Int | Integ |
typedef NTL::matrix< Int > | IntMat |
typedef NTL::vector< Int > | IntVec |
Public Types inherited from LatMRG::MRGLattice< Int, Dbl > | |
typedef Dbl | Dbl |
typedef Int | Int |
typedef NTL::matrix< Int > | IntMat |
typedef NTL::vector< Int > | IntVec |
Public Member Functions | |
ComboLattice (std::vector< MRGComponent< Int > *> &comp, MRGLattice< Int, Dbl > &lat) | |
Creates a ComboLattice for the set of MRG described in comp with a MRG lattice as described in lat . More... | |
ComboLattice (const ComboLattice< Int, Dbl > &lat) | |
Copy constructor. More... | |
~ComboLattice () | |
Destructor. More... | |
std::string & | getCompString (int i) |
std::string | toString () const override |
Prints a string describing all the componenets and the equivalent MRG. More... | |
Public Member Functions inherited from LatMRG::MRGLattice< Int, Dbl > | |
MRGLattice (const Int &m, const IntVec &a, int maxDim, int k, LatticeType latt, LatticeTester::NormType norm=LatticeTester::L2NORM) | |
Constructor with modulus of congruence \(m\), order of the recurrence \(k\), multipliers \(a\), maximal dimension MaxDim , and lattice type Latt . More... | |
MRGLattice (const Int &m, const Int &a, int maxDim, LatticeType latt, LatticeTester::NormType norm=LatticeTester::L2NORM) | |
Alternative constructor for a LCG. More... | |
MRGLattice (const Int &m, const IntVec &a, int maxDim, int k, IntVec &lac, LatticeType latt, LatticeTester::NormType norm=LatticeTester::L2NORM) | |
As in the constructor above but the basis is built for the lacunary indices lac . More... | |
MRGLattice (const MRGLattice< Int, Dbl > &Lat) | |
Copy constructor. More... | |
~MRGLattice () | |
Destructor. More... | |
virtual void | buildBasis (int d) |
Builds the basis in dimension \(d\). More... | |
Int & | getLac (int j) |
Returns the \(j\)-th lacunary index. More... | |
virtual void | incDim () |
Increments the dimension of the basis by 1 by calling either incDimBasis or incDimLaBasis . More... | |
bool | isLacunary () const |
Returns true for the case of lacunary indices, returns false for non-lacunary indices. More... | |
void | kill () |
Cleans and releases memory used by this object. More... | |
MRGLattice< Int, Dbl > & | operator= (const MRGLattice< Int, Dbl > &Lat) |
Assigns Lat to this object. More... | |
virtual void | setLac (const LatticeTester::Lacunary< Int > &lat) |
Sets the lacunary indices for this lattice to lat . More... | |
Int | getRho () const |
Int | getLossRho () const |
void | setRho (const Int &val) |
void | setLossRho (const Int &val) |
const IntVec & | getCoef () const |
Returns a non-mutable copy of the multipliers (coefficients) of the MRG. More... | |
virtual std::string | toStringCoef () const |
Returns the vector of multipliers \(A\) as a string. More... | |
std::string | toString () const override |
Returns the vector of multipliers \(A\) as a string. More... | |
void | setPower2 (std::vector< IntVec > &coeffs) |
Sets m_power2 to true and sets m_pow2_exp to coeffs`. More... | |
void | buildProjection (LatticeTester::IntLattice< Int, Int, Dbl, Dbl > *lattice, const LatticeTester::Coordinates &proj) override |
Builds a projection for this lattice on the set in indices in proj . More... | |
Private Attributes | |
std::vector< MRGComponent< Int > * > | m_comp |
The MRG components of this combined generator. More... | |
std::vector< std::string > | m_compstr |
Strings to represent each component. More... | |
int | m_number |
The number of components stored in this object. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from LatMRG::MRGLattice< Int, Dbl > | |
void | initStates () |
Initializes a square matrix of order \(k\). More... | |
void | init () |
Initializes some of the local variables. More... | |
void | initOrbit () |
Initializes this object when the lattice type is ORBIT . More... | |
void | insertion (IntVec &Sta) |
void | lemme2 (IntVec &Sta) |
void | trace (char *msg, int d) |
For debugging purposes. More... | |
virtual void | incDimBasis () |
Increments the basis by 1 in case of non-lacunary indices. More... | |
void | incDimLaBasis (int) |
Increments the basis by 1 in case of lacunary indices. More... | |
void | buildNaBasis (int d) |
Builds the basis of the MRG recurrence in case of non-lacunary indices. More... | |
void | buildLaBasis (int d) |
Builds the basis of the MRG recurrence in case of lacunary indices. More... | |
Protected Attributes inherited from LatMRG::MRGLattice< Int, Dbl > | |
IntVec | m_aCoef |
The coefficients of the recurrence. More... | |
bool * | m_ip |
When the flag m_ip[i] is true , the \(i\)-th diagonal element of matrix m_sta is non-zero (modulo \(m\)) and divides \(m\). More... | |
LatticeTester::Lacunary< Int > | m_lac |
Contains the lacunary indices when LacunaryFlag is true , otherwise is undefined. More... | |
bool | m_lacunaryFlag |
Is true in the case of lacunary indices, false otherwise. More... | |
LatticeType | m_latType |
Indicates which lattice or sublattice is analyzed. More... | |
IntMat | m_sta |
Matrix that contains the vectors that can be used to generate the basis for an arbitrary dimension. More... | |
Int | m_lossRho |
Int | m_rho |
Int | m_t4 |
Work variables. More... | |
Int | m_t5 |
Int | m_t6 |
Int | m_t7 |
Int | m_t8 |
Int | m_e |
IntVec | m_xi |
This class represents a combined MRG.
It stores a vector of MRGComponent
and computes the equivalent MRG to their combination. Note that MRGComponenets do not have to be MRG themselves. This only overrides the toString()
method and provides a constructor that populates the MRGLattice super-class to use this class in methods without an overload specific to it.
typedef Dbl LatMRG::ComboLattice< Int, Dbl >::Float |
typedef Int LatMRG::ComboLattice< Int, Dbl >::Integ |
typedef NTL::matrix<Int> LatMRG::ComboLattice< Int, Dbl >::IntMat |
typedef NTL::vector<Int> LatMRG::ComboLattice< Int, Dbl >::IntVec |
LatMRG::ComboLattice< Int, Dbl >::ComboLattice | ( | std::vector< MRGComponent< Int > *> & | comp, |
MRGLattice< Int, Dbl > & | lat | ||
) |
Creates a ComboLattice for the set of MRG described in comp
with a MRG lattice as described in lat
.
Ideally, lat
has been initialized with getLatCombo
.
LatMRG::ComboLattice< Int, Dbl >::ComboLattice | ( | const ComboLattice< Int, Dbl > & | lat | ) |
Copy constructor.
LatMRG::ComboLattice< Int, Dbl >::~ComboLattice | ( | ) |
Destructor.
Deallocate memory to m_comp
.
|
inline |
|
override |
Prints a string describing all the componenets and the equivalent MRG.
|
private |
The MRG components of this combined generator.
|
private |
Strings to represent each component.
|
private |
The number of components stored in this object.