Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
marmoteInterval.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 /* marmoteInterval.h ---
17  *
18  * Author: Alain Jean-Marie
19  */
20 
21 /* Commentary:
22  *
23  */
24 
25 /* Change log:
26  *
27  */
28 
29 
30 #ifndef MARMOTEINTERVAL_H
31 #define MARMOTEINTERVAL_H
32 #include "marmoteSet.h"
33 
39 
40  protected:
41  int _min;
42  int _max;
44  public:
52  marmoteInterval( int min, int max );
53 
54  public:
60  bool isFinite() { return true; };
64  bool isZero(int* buffer);
69  void firstState(int* buffer);
73  void nextState(int *buffer);
77  void decodeState(int index, int* buffer);
81  int index(int* buffer);
85  void printState(FILE* out, int *buffer);
86 
87  public:
92  void enumerate();
93 
94 };
95 
96 #endif // MARMOTEINTERVAL_H
void enumerate()
Enumeration procedure.
marmoteInterval(int min, int max)
Definition: marmoteInterval.cpp:20
bool isFinite()
Test if the set is finite. These sets always are.
Definition: marmoteInterval.h:60
bool isZero(int *buffer)
Function that tests whether a state is the first state (state zero) or not.
Definition: marmoteInterval.cpp:43
void printState(FILE *out, int *buffer)
Procedure to print a state, given by its full description, to some file descriptor.
Definition: marmoteInterval.cpp:79
int index(int *buffer)
Function that computes the number (index) of some state in the order of the set. The base class provi...
Definition: marmoteInterval.cpp:71
void firstState(int *buffer)
Initializes some state buffer with the first state of the set.
Definition: marmoteInterval.cpp:51
void decodeState(int index, int *buffer)
Procedure that converts an index into a state. The state is written in the buffer provided...
Definition: marmoteInterval.cpp:65
int _min
Definition: marmoteInterval.h:41
The mother class representing abstract sets.
Definition: marmoteSet.h:48
int _max
Definition: marmoteInterval.h:42
void nextState(int *buffer)
Procedure to compute the state following a given state in the set order. The new state is computed in...
Definition: marmoteInterval.cpp:57
The class describing a finite integer interval.
Definition: marmoteInterval.h:38