Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
marmoteBox.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 #ifndef MARMOTEBOX_H
17 #define MARMOTEBOX_H
18 
19 #include "marmoteSet.h"
20 
21 class marmoteBox : public marmoteSet
22 {
23 private:
24  int _nbDims;
25  int* _dimSize;
26  int* _lVal;
27  int* _uVal;
29 public:
37  marmoteBox(int nbDims, int* dimSize);
46  marmoteBox(int nbDims, int *lower, int* upper);
50  ~marmoteBox();
55  bool isFinite();
61  bool isZero(int* buffer);
66  void firstState(int* buffer);
70  void nextState(int *buffer);
77  void decodeState(int index, int* buf);
83  int index(int* buf);
89  void printState(FILE* out, int *buffer);
90 
91 };
92 
93 #endif // MARMOTEBOX_H
int index(int *buf)
Utility to find the number of some state.
Definition: marmoteBox.cpp:160
bool isZero(int *buffer)
Tests that a state, given by its vector representation, is zero.
Definition: marmoteBox.cpp:119
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.
Definition: marmoteBox.cpp:23
~marmoteBox()
Destructor.
Definition: marmoteBox.cpp:97
void firstState(int *buffer)
Initializes some state buffer with the first state of the set.
Definition: marmoteBox.cpp:131
void decodeState(int index, int *buf)
utility to convert a state index into a state array
Definition: marmoteBox.cpp:150
bool isFinite()
Test whether the set is finite. Boxes are finite if and only if the size in each dimension is finite...
Definition: marmoteBox.cpp:107
The mother class representing abstract sets.
Definition: marmoteSet.h:33
void printState(FILE *out, int *buffer)
Procedure for printing out a state.
Definition: marmoteBox.cpp:171
Definition: marmoteBox.h:6
void nextState(int *buffer)
Procedure to compute the state following a given state in the set order. The new state is computed in...
Definition: marmoteBox.cpp:139