Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
multiDimHomTransition.h
1 #ifndef MULTIDIMHOMTRANSITION_H
2 #define MULTIDIMHOMTRANSITION_H
3 
4 #include "transitionStructure.h"
5 #include <iostream>
6 #include <string>
7 
8 using namespace std;
9 
24 {
25 protected:
26  int _nbDims;
27  int *_dimSize;
28  double *_p;
29  double *_q;
31 private:
32  int *_mu;
33  double _r;
34  int *_fromState;
35  int *_toState;
36  int _nbMaxTrans;
37  int _storedState;
38  int* _colNum;
39  double* _colVal;
41 public:
42  // constructors
50  multiDimHomTransition(int nbDims, int* dimSize, double* p, double* q);
56 
57 public:
58  // accessors
64  int dimSize(int d) { return _dimSize[d]; };
70  double p(int d) { return _p[d]; };
76  double q(int d) { return _q[d]; };
77 
78 public:
79  // implementation of virtual methods
80  bool setEntry(int i, int j, double val);
81  double getEntry(int i, int j);
82  int getNbElts(int i);
83  int getCol(int i, int k);
84  double getEntryByCol(int i, int k);
85  discreteDistribution* getTransDistrib(int i);
86  double rowSum(int i);
87  multiDimHomTransition* copy();
88  multiDimHomTransition* uniformize();
89  void evaluateMeasure(double* d,double* res);
90  void evaluateMeasure(discreteDistribution* d, discreteDistribution* res);
91  void evaluateValue(double* v, double* res);
92  void write(FILE* out, string format);
93 
94 public:
95  // specific methods
96  discreteDistribution* getJumpDistribution();
97 
98 private:
99  // specific utilities
100  void decodeState( int index, int* buf );
101  void nextState( int* buf );
102  void decodeTransitions( int index );
103 
104 };
105 
106 #endif // MULTIDIMHOMTRANSITION_H
double p(int d)
Read accessor for the jump probability to the right in each dimension.
Definition: multiDimHomTransition.h:70
int * _dimSize
size of the state space in each dimension
Definition: multiDimHomTransition.h:27
int _nbDims
the number of dimensions
Definition: multiDimHomTransition.h:26
double * _q
probas to jump to the left in each dimension
Definition: multiDimHomTransition.h:29
int dimSize(int d)
Read accessor for the size of the state space in each dimension.
Definition: multiDimHomTransition.h:64
Abstract class for transition structures. These are structures which describe transitions to one stat...
Definition: transitionStructure.h:17
Class for multidimensional, homogeneous random walk transition structures. These are characterized by...
Definition: multiDimHomTransition.h:23
The general discrete distribution with finite support.
Definition: discreteDistribution.h:25
double * _p
probas to jump to the right in each dimension
Definition: multiDimHomTransition.h:28
double q(int d)
Read accessor for the jump probability to the right in each dimension.
Definition: multiDimHomTransition.h:76