LatMRG Guide  1.0
A software package to test and search for new linear congruential random number generators
LatMRG::Projections Class Reference

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

Sequential: minDim to m_projDim[0]+1
Projections Dimension i
Coordinates m_projDim[i-1]+1

. More...

 

Private Attributes

std::vector< std::size_t > m_curProj
 
int m_currentDim
 
int m_minDim
 
int m_numDim
 
std::vector< int > m_projDim
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Projections()

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.

Member Function Documentation

◆ end()

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.

◆ getDim()

int LatMRG::Projections::getDim ( )

Returns the dimension of the current projections.

This does not return the value of m_currentDim

◆ getProj()

LatticeTester::Coordinates LatMRG::Projections::getProj ( )

Returns the current projection the object is at.

◆ maxDim()

int LatMRG::Projections::maxDim ( )
inline

◆ minDim()

int LatMRG::Projections::minDim ( )
inline

◆ next()

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

◆ numProj()

int LatMRG::Projections::numProj ( )
inline

◆ operator++()

LatticeTester::Coordinates LatMRG::Projections::operator++ ( )

Returns the result of next().

This is for convenience.

◆ projDim()

std::vector<int>& LatMRG::Projections::projDim ( )
inline

◆ resetDim()

void LatMRG::Projections::resetDim ( int  dim = 0)

◆ toString()

std::string LatMRG::Projections::toString ( )

Returns a string describing this object of the form

Sequential: minDim to m_projDim[0]+1
Projections Dimension i
Coordinates m_projDim[i-1]+1

.

Member Data Documentation

◆ m_curProj

std::vector<std::size_t> LatMRG::Projections::m_curProj
private

◆ m_currentDim

int LatMRG::Projections::m_currentDim
private

◆ m_minDim

int LatMRG::Projections::m_minDim
private

◆ m_numDim

int LatMRG::Projections::m_numDim
private

◆ m_projDim

std::vector<int> LatMRG::Projections::m_projDim
private

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