Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
Public Member Functions | Protected Attributes | List of all members
marmoteSet Class Referenceabstract

The mother class representing abstract sets. More...

#include <marmoteSet.h>

Inheritance diagram for marmoteSet:
marmoteBox marmoteInterval

Public Member Functions

 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...
 
virtual bool isFinite ()=0
 Test if the set is finite. 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...
 
virtual void firstState (int *buffer)
 Procedure that initializes the state buffer to the first state in the set. More...
 
virtual 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...
 
virtual void decodeState (int index, int *buffer)
 Procedure that converts an index into a state. The state is written in the buffer provided. The array must have been allocated before. 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 bool isZero (int *buffer)
 Function that tests whether a state is the first state (state zero) or not. More...
 
virtual void printState (FILE *out, int *buffer)
 Procedure to print a state, given by its full description, to some file descriptor. More...
 
virtual void printState (FILE *out, int index)
 Procedure to print a state, given by its index, to some file descriptor. More...
 

Protected Attributes

bool _isSimple
 
bool _isUnion
 
bool _isProduct
 
int _nbDimensions
 
int _nbZones
 
long int _cardinal
 
marmoteSet ** _zone
 
marmoteSet ** _dimension
 
int * _zeroState
 

Detailed Description

The mother class representing abstract sets.

Constructor & Destructor Documentation

marmoteSet::marmoteSet ( marmoteSet **  list,
int  nb,
opType  t 
)

Constructor for composite sets, from smaller sets.

Parameters
listthe list of elements in the composite
nbthe number of elements in the composite
tthe type of composite: UNION or PRODUCT
marmoteSet::~marmoteSet ( )
virtual

Destructor for general sets. Essentially for composite structures.

Member Function Documentation

long int marmoteSet::cardinal ( )
virtual

Cardinal of the set.

Returns
an integer, the cardinal of the set, or INFINITE_STATE_SPACE_SIZE
void marmoteSet::decodeState ( int  index,
int *  buffer 
)
virtual

Procedure that converts an index into a state. The state is written in the buffer provided. The array must have been allocated before.

Parameters
indexindex of the state to be decoded
bufferstate buffer containing the resulting state

Reimplemented in marmoteBox, and marmoteInterval.

void marmoteSet::enumerate ( )
virtual

Enumerates the set: lists all elements of the set. PROBLEM: enumerate where? in a file? to be specified more precisely.

Reimplemented in marmoteInterval.

void marmoteSet::firstState ( int *  buffer)
virtual

Procedure that initializes the state buffer to the first state in the set.

Parameters
bufferthe buffer to be initialized. Must have been allocated before.

Reimplemented in marmoteInterval, and marmoteBox.

int marmoteSet::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.

Parameters
bufferstate buffer containing the state
Returns
the index of the state
virtual bool marmoteSet::isFinite ( )
pure virtual

Test if the set is finite.

Returns
true if the set is finite, false if not.

Implemented in marmoteInterval, and marmoteBox.

bool marmoteSet::isProduct ( )
inline

Test if the set is a composite, product set.

Returns
true if the set is a product, false otherwise.
bool marmoteSet::isSimple ( )
inline

Test if the set is a simple, elementary set.

Returns
true if the set is elementary, false otherwise.
bool marmoteSet::isUnion ( )
inline

Test if the set is a composite, product set.

Returns
true if the set is a product, false otherwise.
bool marmoteSet::isZero ( int *  buffer)
virtual

Function that tests whether a state is the first state (state zero) or not.

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

Reimplemented in marmoteInterval, and marmoteBox.

void marmoteSet::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 in marmoteInterval, and marmoteBox.

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

Procedure to print a state, given by its full description, to some file descriptor.

Parameters
outthe file descriptor to be used
bufferthe state to be printed

Reimplemented in marmoteBox, and marmoteInterval.

void marmoteSet::printState ( FILE *  out,
int  index 
)
virtual

Procedure to print a state, given by its index, to some file descriptor.

Parameters
outthe file descriptor to be used
indexindex of the state to be printed
int marmoteSet::totNbDims ( )
inline

Read accessor to the total number of dimensions.

Returns
The total number of dimensions of a vector representation.

Member Data Documentation

long int marmoteSet::_cardinal
protected

cardinal of the set

marmoteSet** marmoteSet::_dimension
protected

array of dimensions, in case of a product

bool marmoteSet::_isProduct
protected

indicator that the set is a cartesian product of other sets

bool marmoteSet::_isSimple
protected

indicator that the set is simple (elementary)

bool marmoteSet::_isUnion
protected

indicator that the set is a union of other sets

int marmoteSet::_nbDimensions
protected

number of dimensions if this is a product

int marmoteSet::_nbZones
protected

number of subsets if this is a union

int* marmoteSet::_zeroState
protected

the representation of the initial state (static)

marmoteSet** marmoteSet::_zone
protected

array of zones, in case of a union


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