Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
marmoteSet.h
1 /* Marmote is free software: you can redistribute it and/or modify
2 it under the terms of the GNU General Public License as published by
3 the Free Software Foundation, either version 3 of the License, or
4 (at your option) any later version.
5 
6 Marmote is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 GNU General Public License for more details.
10 
11 You should have received a copy of the GNU General Public License
12 along with Marmote. If not, see <http://www.gnu.org/licenses/>.
13 
14 Copyright 2015 Alain Jean-Marie, Jean-Michel Fourneau, Jean-Marc Vincent, Issam Rabhi */
15 
16 /* marmoteSet.h ---
17  *
18  * Author: Alain Jean-Marie
19  */
20 
21 /* Commentary:
22  *
23  */
24 
25 /* Change log:
26  *
27  */
28 
29 
30 #ifndef MARMOTESET_H
31 #define MARMOTESET_H
32 
33 #include "../marmoteConstants.h"
34 #include <stdio.h>
35 
42 enum opType { UNION, PRODUCT, SIMPLE };
43 
48 class marmoteSet {
49 
50 protected:
51  bool _isSimple;
52  bool _isUnion;
53  bool _isProduct;
54  int _nbDimensions;
55  int _nbZones;
56  long int _cardinal;
57  marmoteSet** _zone;
60 private:
61  int* _stateBuffer;
62  int* _dimOffset;
63  int* _idxOffset;
64  int _totNbDims;
66 protected:
67  int* _zeroState;
69 public:
74  marmoteSet();
82  marmoteSet( marmoteSet **list, int nb, opType t );
86  virtual ~marmoteSet();
87 
88 public:
94  virtual long int cardinal();
100  virtual bool isFinite() = 0;
106  bool isSimple() { return _isSimple; };
112  bool isUnion() { return _isUnion; };
118  bool isProduct() { return _isProduct; };
123  int totNbDims() { return _totNbDims; };
124 
125  public:
130  virtual void enumerate();
131 
132  virtual void firstState(int* buffer);
139  virtual void nextState(int* buffer);
140  virtual void decodeState(int index, int* buffer);
141  virtual bool isZero(int* buffer);
142  virtual void printState(FILE* out, int* buffer);
143  virtual void printState(FILE* out, int index);
144 };
145 
146 #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:112
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:106
bool isProduct()
Test if the set is a composite, product set.
Definition: marmoteSet.h:118
int * _zeroState
Definition: marmoteSet.h:52
int totNbDims()
Read accessor to the total number of dimensions.
Definition: marmoteSet.h:123