Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
eventMixture.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 EVENTMIXTURE_H
17 #define EVENTMIXTURE_H
18 
19 #include "transitionStructure.h"
20 #include "sparseMatrix.h"
21 #include <string>
22 
24 {
25 private:
26  // specific attributes
27  int _nbEvents;
28  double* _eventProba;
29  std::string* _eventName;
30  int** _eventTransition;
32 public:
33  // constructors, destructor
42  eventMixture(int size, int nbEvents, double* probas, std::string* names, int** transitions );
47  eventMixture(sparseMatrix* spMat);
52  ~eventMixture();
53 
54 public:
55  // accessors
60  int nbEvents() { return _nbEvents; }
66  double eventProba(int e) { return _eventProba[e]; }
67 
68 public:
69  // implementation of virtual methods
70  bool setEntry(int i, int j, double val);
71  double getEntry(int i, int j);
72  int getNbElts(int i);
73  int getCol(int i, int k);
74  double getEntryByCol(int i, int k);
76  double rowSum(int i);
77  eventMixture* copy();
83  void evaluateMeasure(double* d, double* res) ;
84 
89 
90  void evaluateValue(double* v, double* res);
91  void write(FILE* out, std::string format);
92 
93 private:
94  // specific technical methods
106  int consolidate(int i, int* destinations, double* values);
107 };
108 
109 #endif // EVENTMIXTURE_H
int getCol(int i, int k)
Method to get the number of the state corresponding to transition number k in the list of possible tr...
Definition: eventMixture.cpp:155
double rowSum(int i)
Sum of entries on some row i. Always 1.0 since this is a discrete-time transition structure...
Definition: eventMixture.cpp:188
discreteDistribution * getTransDistrib(int i)
Method to get the transition from some state as a probability distribution.
Definition: eventMixture.cpp:171
eventMixture * copy()
Copying a transition structure.
Definition: eventMixture.cpp:196
eventMixture * embed()
Embedding in a transition structure. Since the origin structure is already of discrete-time type...
Definition: eventMixture.cpp:221
eventMixture(int size, int nbEvents, double *probas, std::string *names, int **transitions)
Constructor from arrays.
Definition: eventMixture.cpp:22
int getNbElts(int i)
Method to get the number of non-zero entries in a transition from some state. This can be seen as the...
Definition: eventMixture.cpp:147
double eventProba(int e)
Read accessor for the probabilities associated to each event.
Definition: eventMixture.h:66
int nbEvents()
Read accessor for the number of events.
Definition: eventMixture.h:60
void evaluateMeasure(double *d, double *res)
Computing the action of the transition structure on some measure, the measure being represented as a ...
Definition: eventMixture.cpp:226
bool setEntry(int i, int j, double val)
Method to set the value associated with some transition. Not applicable here.
Definition: eventMixture.cpp:124
Definition: eventMixture.h:23
Abstract class for transition structures. These are structures which describe transitions to one stat...
Definition: transitionStructure.h:33
eventMixture * uniformize()
Uniformizing a transition structure. Since the origin structure is already of discrete-time type...
Definition: eventMixture.cpp:210
double getEntryByCol(int i, int k)
Method to get the value attached to transition number k in the list of possible transitions from some...
Definition: eventMixture.cpp:163
Class sparseMatrix: implementation of a transition structure using the sparse matrix data structure...
Definition: sparseMatrix.h:29
void write(FILE *out, std::string format)
Output method for the transition structure. Supported formats are: XBORNE, MARCA, Ers...
Definition: eventMixture.cpp:268
int size()
Read accessor for the size of the state space. This is the origin state space by default.
Definition: transitionStructure.h:59
double getEntry(int i, int j)
Method to get the value associated with some transition. When state parameters are out of bounds...
Definition: eventMixture.cpp:134
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25
void evaluateValue(double *v, double *res)
Computing the action of the transition structure on some vector of values. This corresponds to the mu...
Definition: eventMixture.cpp:248
~eventMixture()
Destructor of the class.
Definition: eventMixture.cpp:110