LatMRG Guide
1.0
A software package to test and search for new linear congruential random number generators
|
A projection class that does exactly what we need when generating projections when testing a generator. More...
#include <latmrg/Projections.h>
Public Member Functions | |
Projections (int dimProj, int minDim, std::vector< int > &projDim) | |
Creates a Projections set. More... | |
bool | end (int dim=0) |
If dim==0 this will return true if this calling next will not get a new projection. More... | |
int | getDim () |
Returns the dimension of the current projections. More... | |
LatticeTester::Coordinates | getProj () |
Returns the current projection the object is at. More... | |
int | maxDim () |
int | minDim () |
LatticeTester::Coordinates | next () |
This returns the next projection for this set of projections. More... | |
int | numProj () |
LatticeTester::Coordinates | operator++ () |
Returns the result of next(). More... | |
std::vector< int > & | projDim () |
void | resetDim (int dim=0) |
std::string | toString () |
Returns a string describing this object of the form. More... | |
Private Attributes | |
std::vector< std::size_t > | m_curProj |
int | m_currentDim |
int | m_minDim |
int | m_numDim |
std::vector< int > | m_projDim |
A projection class that does exactly what we need when generating projections when testing a generator.
This is initialized containing nothing and can iteratively return projections by calling next()
. This first goes a through a list of sequential projections and then gives a list of projections with non sequential indices.
When iterating through this object, it returns LatticeTester::Coordinates
objects. These contain coordinates starting from 0
to be used when accessing elements in vectors. Take care, some of the functions in this objects take integers starting at 1 that are transformed by the object.
LatMRG::Projections::Projections | ( | int | dimProj, |
int | minDim, | ||
std::vector< int > & | projDim | ||
) |
Creates a Projections set.
It is necessary that dimProj == length(projDim)
.
This set will contain projections with sequential indices in dimensions minDim
to projDim[0]+1
. That means the projections will include sets {0, ..., minDim-1}
through {0, ..., projDim[0]}
.
When the length of projDim
is greater than 1, this set will contain non sequential projections in dimensions 2 through dimProj
. Projections in dimension i
use i
indices in the range [0, projDim[i-1]]
with at least one of them at least minDim-1
.
bool LatMRG::Projections::end | ( | int | dim = 0 | ) |
If dim==0
this will return true if this calling next will not get a new projection.
If dim==1
this will return true if the current projection dimension is over.
int LatMRG::Projections::getDim | ( | ) |
Returns the dimension of the current projections.
This does not return the value of m_currentDim
LatticeTester::Coordinates LatMRG::Projections::getProj | ( | ) |
Returns the current projection the object is at.
|
inline |
|
inline |
LatticeTester::Coordinates LatMRG::Projections::next | ( | ) |
This returns the next projection for this set of projections.
If this object is not initialized, this fills it with the first projection with indices from 0
to m_minDim-1
. It then adds coordinates up to m_projDim[0]
. It then returns coordinates
|
inline |
LatticeTester::Coordinates LatMRG::Projections::operator++ | ( | ) |
Returns the result of next().
This is for convenience.
|
inline |
void LatMRG::Projections::resetDim | ( | int | dim = 0 | ) |
std::string LatMRG::Projections::toString | ( | ) |
Returns a string describing this object of the form.
|
private |
|
private |
|
private |
|
private |
|
private |