COPASI API  4.40.278
CPermutation Class Reference

#include <CPermutation.h>

Public Member Functions

 CPermutation (const CPermutation &src)
 
 CPermutation (CRandom *pRandom, const size_t &size)
 
void init ()
 
const size_t & next ()
 
const size_t & pick ()
 
void shuffle (const size_t &swaps=C_INVALID_INDEX)
 
 ~CPermutation ()
 

Private Member Functions

 CPermutation ()
 

Private Attributes

size_t * mpBeyond
 
size_t * mpNext
 
CRandommpRandom
 
CVector< size_t > mVector
 

Static Private Attributes

static size_t InvalidIndex
 

Constructor & Destructor Documentation

◆ CPermutation() [1/3]

CPermutation::CPermutation ( )
private

Default constructor

◆ CPermutation() [2/3]

CPermutation::CPermutation ( CRandom pRandom,
const size_t &  size 
)

Specific constructor

Parameters
CRandom* pRandom
constsize_t & size

References init().

◆ CPermutation() [3/3]

CPermutation::CPermutation ( const CPermutation src)

Copy constructor

Parameters
constCPermutation & src

References CVectorCore< CType >::array(), mpBeyond, mpNext, mVector, and CVectorCore< CType >::size().

◆ ~CPermutation()

CPermutation::~CPermutation ( )

Destructor

Member Function Documentation

◆ init()

void CPermutation::init ( )

Initialize the permutation

References CVectorCore< CType >::array(), mpBeyond, mpNext, mVector, and CVectorCore< CType >::size().

Referenced by CPermutation().

◆ next()

◆ pick()

const size_t & CPermutation::pick ( )

◆ shuffle()

void CPermutation::shuffle ( const size_t &  swaps = C_INVALID_INDEX)

Member Data Documentation

◆ InvalidIndex

size_t CPermutation::InvalidIndex
staticprivate

Referenced by next(), and pick().

◆ mpBeyond

size_t* CPermutation::mpBeyond
private

A pointer beyond the last index

Referenced by CPermutation(), init(), and next().

◆ mpNext

size_t* CPermutation::mpNext
private

A pointer to the next index

Referenced by CPermutation(), init(), next(), pick(), and shuffle().

◆ mpRandom

CRandom* CPermutation::mpRandom
private

A pointer to the random number generator to be used

Referenced by next(), pick(), and shuffle().

◆ mVector

CVector< size_t > CPermutation::mVector
private

A vector containing the permutation

Referenced by CPermutation(), init(), next(), pick(), and shuffle().


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