Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
marmoteSet.h
1 /* marmoteSet.h ---
2  *
3  * Author: Alain Jean-Marie
4  */
5 
6 /* Commentary:
7  *
8  */
9 
10 /* Change log:
11  *
12  */
13 
14 
15 #ifndef MARMOTESET_H
16 #define MARMOTESET_H
17 
18 #include "../marmoteConstants.h"
19 #include <stdio.h>
20 
27 enum opType { UNION, PRODUCT, SIMPLE };
28 
33 class marmoteSet {
34 
35 protected:
36  bool _isSimple;
37  bool _isUnion;
38  bool _isProduct;
40  int _nbZones;
41  long int _cardinal;
45 private:
46  int* _stateBuffer;
47  int* _dimOffset;
48  int* _idxOffset;
49  int _totNbDims;
51 protected:
52  int* _zeroState;
54 public:
59  marmoteSet();
67  marmoteSet( marmoteSet **list, int nb, opType t );
71  virtual ~marmoteSet();
72 
73 public:
79  virtual long int cardinal();
85  virtual bool isFinite() = 0;
91  bool isSimple() { return _isSimple; };
97  bool isUnion() { return _isUnion; };
103  bool isProduct() { return _isProduct; };
108  int totNbDims() { return _totNbDims; };
109 
110  public:
115  virtual void enumerate();
116 
117  virtual void firstState(int* buffer);
124  virtual void nextState(int* buffer);
125  virtual void decodeState(int index, int* buffer);
126  virtual bool isZero(int* buffer);
127  virtual void printState(FILE* out, int* buffer);
128  virtual void printState(FILE* out, int index);
129 };
130 
131 #endif
marmoteSet ** _zone
Definition: marmoteSet.h:42
virtual long int cardinal()
Cardinal of the set.
Definition: marmoteSet.cpp:105
bool _isProduct
Definition: marmoteSet.h:38
virtual ~marmoteSet()
Definition: marmoteSet.cpp:92
long int _cardinal
Definition: marmoteSet.h:41
virtual void enumerate()
Enumerates the set: lists all elements of the set. PROBLEM: enumerate where? in a file...
Definition: marmoteSet.cpp:129
bool isUnion()
Test if the set is a composite, product set.
Definition: marmoteSet.h:97
bool _isSimple
Definition: marmoteSet.h:36
virtual void nextState(int *buffer)
Procedure to compute the state following a given state in the set order. The new state is computed in...
Definition: marmoteSet.cpp:190
bool _isUnion
Definition: marmoteSet.h:37
int _nbDimensions
Definition: marmoteSet.h:39
marmoteSet ** _dimension
Definition: marmoteSet.h:43
The mother class representing abstract sets.
Definition: marmoteSet.h:33
int _nbZones
Definition: marmoteSet.h:40
virtual bool isFinite()=0
Test if the set is finite.
bool isSimple()
Test if the set is a simple, elementary set.
Definition: marmoteSet.h:91
bool isProduct()
Test if the set is a composite, product set.
Definition: marmoteSet.h:103
int * _zeroState
Definition: marmoteSet.h:52
int totNbDims()
Read accessor to the total number of dimensions.
Definition: marmoteSet.h:108