Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
hbf.h
Go to the documentation of this file.
1 
2 /* Copyright(C) (2002) (ID - IMAG) <Florent.Morata@imag.fr> */
3 
4 /*
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19 
20 
29 #ifndef _HBF_H_
30 #define _HBF_H_
31 
32 
33 #include <vector>
34 #include <string>
35 #include <fstream>
36 #include <cmath>
37 #include "../transitionStructure/sparseMatrix.h"
38 
40 using namespace std;
41 
43 typedef vector<int>::iterator iteri;
45 typedef vector<double>::iterator iterd;
47 typedef string psi_name;
48 
52 enum psi_type{continuous,discrete};
53 
54 
65 class HBF{
66  private:
67 
69  psi_name model_name;
71  psi_type model_type;
73  int dimension;
75  int nz_number;
77  vector<double> Val;
79  vector<int> Col;
81  vector<int> Row;
83  vector<int> ValbyRow;
85  double biggest;
86 
87  public:
88 
89  // static HBF hbf; // elimination of the static part
90 
91  // constructors
92 public:
93  HBF();
94  HBF( sparseMatrix* mat );
95  ~HBF();
96 
97 public:
98  void create(const int d,const int n);
99  int size() const;
100  int order() const;
101  psi_type type() const;
102  double maxi() const;
103  bool is_empty() const;
104  double val(const int i) const;
105  int col(const int i) const;
106  int row(const int i) const;
107  int valbyrow(const int i) const;
108  int zero_or_one();
109  void update();
110  void read_hbf_r(const psi_name path);
111  void read_marca(const psi_name path);
112  void read_hbf_c(const psi_name path);
113  void uniformization();
114  void write_unif(const psi_name file);
115  void col2row();
116  void convert();
117  void scale(const double d);
118  void give_a_name(const psi_name file);
119  psi_name name() const;
120  int out_degree() const;
121  void transform(const int d);
122 };
123 
124 
125 #include "hbf.inl"
126 
127 
128 #endif
129 
psi_type
Definition: hbf.h:52
Utilization of the Standard Template Library.
Inline methods of HBF Class.
string psi_name
Definition: hbf.h:47
vector< int >::iterator iteri
Definition: hbf.h:43
vector< double >::iterator iterd
Definition: hbf.h:45
Class sparseMatrix: implementation of a transition structure using the sparse matrix data structure...
Definition: sparseMatrix.h:29
Storage of matrix in Harwell Boeing Format.
Definition: hbf.h:65