Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations
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 
39 using namespace std;
40 
42 typedef vector<int>::iterator iteri;
44 typedef vector<double>::iterator iterd;
46 typedef string psi_name;
47 
51 enum psi_type{continuous,discrete};
52 
53 
64 class HBF{
65  private:
66 
68  psi_name model_name;
70  psi_type model_type;
72  int dimension;
74  int nz_number;
76  vector<double> Val;
78  vector<int> Col;
80  vector<int> Row;
82  vector<int> ValbyRow;
84  double biggest;
85 
86  public:
87 
88  static HBF hbf;
89  HBF();
90  void create(const int d,const int n);
91  ~HBF();
92  int size() const;
93  int order() const;
94  psi_type type() const;
95  double maxi() const;
96  bool is_empty() const;
97  double val(const int i) const;
98  int col(const int i) const;
99  int row(const int i) const;
100  int valbyrow(const int i) const;
101  int zero_or_one();
102  void update();
103  void read_hbf_r(const psi_name path);
104  void read_marca(const psi_name path);
105  void read_hbf_c(const psi_name path);
106  void uniformization();
107  void write_unif(const psi_name file);
108  void col2row();
109  void convert();
110  void scale(const double d);
111  void give_a_name(const psi_name file);
112  psi_name name() const;
113  int out_degree() const;
114  void transform(const int d);
115 };
116 
117 
118 #include "hbf.inl"
119 
120 
121 #endif