Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
Public Member Functions | List of all members
marmoteBox Class Reference
Inheritance diagram for marmoteBox:
marmoteSet

Public Member Functions

 marmoteBox (int nbDims, int *dimSize)
 Constructor for a marmoteBox from the arrays of sizes in each dimension. By convention, the SW corner of the box is (0,...,0). All arrays passed as parameters are copied. More...
 
 marmoteBox (int nbDims, int *lower, int *upper)
 Constructor for general boxes, from the arrays of lower/upper values. By convention, these lower/upper values belong to the box. All arrays passed as parameters are copied. More...
 
 ~marmoteBox ()
 Destructor. More...
 
bool isFinite ()
 Test whether the set is finite. Boxes are finite if and only if the size in each dimension is finite. More...
 
bool isZero (int *buffer)
 Tests that a state, given by its vector representation, is zero. More...
 
void firstState (int *buffer)
 Initializes some state buffer with the first state of the set. More...
 
void nextState (int *buffer)
 Procedure to compute the state following a given state in the set order. The new state is computed in place: the original state is erased. By convention, the state following the last state is the first state. More...
 
void decodeState (int index, int *buf)
 utility to convert a state index into a state array More...
 
int index (int *buf)
 Utility to find the number of some state. More...
 
void printState (FILE *out, int *buffer)
 Procedure for printing out a state. More...
 
- Public Member Functions inherited from marmoteSet
 marmoteSet (marmoteSet **list, int nb, opType t)
 Constructor for composite sets, from smaller sets. More...
 
virtual ~marmoteSet ()
 
virtual long int cardinal ()
 Cardinal of the set. More...
 
bool isSimple ()
 Test if the set is a simple, elementary set. More...
 
bool isUnion ()
 Test if the set is a composite, product set. More...
 
bool isProduct ()
 Test if the set is a composite, product set. More...
 
int totNbDims ()
 Read accessor to the total number of dimensions. More...
 
virtual void enumerate ()
 Enumerates the set: lists all elements of the set. PROBLEM: enumerate where? in a file? to be specified more precisely. More...
 
int index (int *buffer)
 Function that computes the number (index) of some state in the order of the set. The base class provides an implementation that uses solely firstState(), nextState(), and state comparison. For efficiency, it is advised to re-implement this method for derived classes. More...
 
virtual void printState (FILE *out, int index)
 Procedure to print a state, given by its index, to some file descriptor. More...
 

Additional Inherited Members

- Protected Attributes inherited from marmoteSet
bool _isSimple
 
bool _isUnion
 
bool _isProduct
 
int _nbDimensions
 
int _nbZones
 
long int _cardinal
 
marmoteSet ** _zone
 
marmoteSet ** _dimension
 
int * _zeroState
 

Constructor & Destructor Documentation

marmoteBox::marmoteBox ( int  nbDims,
int *  dimSize 
)

Constructor for a marmoteBox from the arrays of sizes in each dimension. By convention, the SW corner of the box is (0,...,0). All arrays passed as parameters are copied.

Parameters
nbDimsthe number of dimensions
dimSizearray of size in each dimension (possibly INFINITE_STATE_SPACE_SIZE)
marmoteBox::marmoteBox ( int  nbDims,
int *  lower,
int *  upper 
)

Constructor for general boxes, from the arrays of lower/upper values. By convention, these lower/upper values belong to the box. All arrays passed as parameters are copied.

Parameters
nbDimsthe number of dimensions
lowerarray of lower values in each dimension
upperarray of upper values in each dimension (possibly INFINITE_STATE_SPACE_SIZE)
marmoteBox::~marmoteBox ( )

Destructor.

Member Function Documentation

void marmoteBox::decodeState ( int  index,
int *  buf 
)
virtual

utility to convert a state index into a state array

Author
Alain Jean-Marie
Parameters
indexthe state index
bufthe state buffer to be filled

Reimplemented from marmoteSet.

void marmoteBox::firstState ( int *  buffer)
virtual

Initializes some state buffer with the first state of the set.

Parameters
bufferthe buffer to be set.

Reimplemented from marmoteSet.

int marmoteBox::index ( int *  buf)

Utility to find the number of some state.

Parameters
bufa state buffer
Returns
the index of the state buffer
bool marmoteBox::isFinite ( )
virtual

Test whether the set is finite. Boxes are finite if and only if the size in each dimension is finite.

Implements marmoteSet.

bool marmoteBox::isZero ( int *  buffer)
virtual

Tests that a state, given by its vector representation, is zero.

Parameters
bufferthe state to be tested
Returns
true if the state is 0, false otherwise.

Reimplemented from marmoteSet.

void marmoteBox::nextState ( int *  buffer)
virtual

Procedure to compute the state following a given state in the set order. The new state is computed in place: the original state is erased. By convention, the state following the last state is the first state.

Parameters
bufferthe reference state

Reimplemented from marmoteSet.

void marmoteBox::printState ( FILE *  out,
int *  buffer 
)
virtual

Procedure for printing out a state.

Parameters
outfile descriptor of the stream to be used
bufferthe state buffer to be printed

Reimplemented from marmoteSet.


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