COPASI API
4.16.103
|
#include <CPermutation.h>
Public Member Functions | |
CPermutation (CRandom *pRandom, const size_t &size) | |
CPermutation (const CPermutation &src) | |
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 |
CRandom * | mpRandom |
CVector< size_t > | mVector |
Static Private Attributes | |
static size_t | InvalidIndex |
Definition at line 13 of file CPermutation.h.
|
private |
CPermutation::CPermutation | ( | CRandom * | pRandom, |
const size_t & | size | ||
) |
Specific constructor
CRandom | * pRandom |
const | size_t & size |
Definition at line 21 of file CPermutation.cpp.
References init().
CPermutation::CPermutation | ( | const CPermutation & | src | ) |
Copy constructor
const | CPermutation & src |
Definition at line 30 of file CPermutation.cpp.
References CVectorCore< CType >::array(), mpBeyond, mpNext, mVector, and CVectorCore< CType >::size().
CPermutation::~CPermutation | ( | ) |
void CPermutation::init | ( | ) |
Initialize the permutation
Definition at line 46 of file CPermutation.cpp.
References CVectorCore< CType >::array(), mpBeyond, mpNext, mVector, and CVectorCore< CType >::size().
Referenced by CPermutation().
const size_t & CPermutation::next | ( | ) |
Pick the next element
Definition at line 106 of file CPermutation.cpp.
References InvalidIndex, mpBeyond, mpNext, mpRandom, mVector, and CVectorCore< CType >::size().
Referenced by COptMethodPS::buildInformants(), COptMethodDE::replicate(), COptMethodGA::replicate(), and COptMethodGASR::replicate().
const size_t & CPermutation::pick | ( | ) |
Pick a random element
Definition at line 94 of file CPermutation.cpp.
References CVectorCore< CType >::array(), CRandom::getRandomU(), InvalidIndex, mpNext, mpRandom, mVector, and CVectorCore< CType >::size().
Referenced by COptMethodPS::buildInformants(), and COptMethodDE::replicate().
void CPermutation::shuffle | ( | const size_t & | swaps = C_INVALID_INDEX | ) |
Shuffle the permutation const size_t & swaps (Default: size of permutation)
Definition at line 64 of file CPermutation.cpp.
References CVectorCore< CType >::array(), C_INT32, CRandom::getRandomU(), max, min, mpNext, mpRandom, mVector, and CVectorCore< CType >::size().
Referenced by COptMethodPS::buildInformants(), COptMethodDE::replicate(), COptMethodGA::replicate(), and COptMethodGASR::replicate().
|
staticprivate |
Definition at line 16 of file CPermutation.h.
|
private |
A pointer beyond the last index
Definition at line 83 of file CPermutation.h.
Referenced by CPermutation(), init(), and next().
|
private |
A pointer to the next index
Definition at line 78 of file CPermutation.h.
Referenced by CPermutation(), init(), next(), pick(), and shuffle().
|
private |
A pointer to the random number generator to be used
Definition at line 68 of file CPermutation.h.
|
private |
A vector containing the permutation
Definition at line 73 of file CPermutation.h.
Referenced by CPermutation(), init(), next(), pick(), and shuffle().