MultiAgentDecisionProcess
Release 0.2.1
Main Page
Namespaces
Classes
Files
File List
File Members
TransitionModelMappingSparse.h
Go to the documentation of this file.
1
28
/* Only include this header file once. */
29
#ifndef _TRANSITIONMODELMAPPINGSPARSE_H_
30
#define _TRANSITIONMODELMAPPINGSPARSE_H_ 1
31
32
/* the include directives */
33
#include "
Globals.h
"
34
#include "
TransitionModelDiscrete.h
"
35
#include <boost/numeric/ublas/matrix_sparse.hpp>
36
//#include "TGet.h"
37
class
TGet
;
38
class
TGet_TransitionModelMappingSparse
;
39
41
42
class
TransitionModelMappingSparse
:
public
TransitionModelDiscrete
43
{
44
public
:
45
46
#if BOOST_1_32_OR_LOWER // they renamed sparse_vector to mapped_vector
47
typedef
boost::numeric::ublas::sparse_matrix<double>
SparseMatrix
;
48
#else
49
typedef
boost::numeric::ublas::compressed_matrix<double>
SparseMatrix
;
50
#endif
51
52
private
:
53
54
std::vector<SparseMatrix* >
_m_T
;
55
56
protected
:
57
58
public
:
59
// Constructor, destructor and copy assignment.
61
TransitionModelMappingSparse
(
int
nrS = 1,
int
nrJA = 1);
62
64
TransitionModelMappingSparse
(
const
TransitionModelMappingSparse
& TM);
65
67
~TransitionModelMappingSparse
();
68
70
double
Get
(
Index
sI,
Index
jaI,
Index
sucSI)
const
71
{
return
((*
_m_T
[jaI])(sI,sucSI)); }
72
75
79
void
Set
(
Index
sI,
Index
jaI,
Index
sucSI,
double
prob
)
80
{
81
// make sure probability is not 0
82
if
(prob >
PROB_PRECISION
)
83
(*
_m_T
[jaI])(sI,sucSI)=
prob
;
84
}
85
87
const
SparseMatrix
*
GetMatrixPtr
(
Index
a)
const
88
{
return
(
_m_T
.at(a)); }
89
91
virtual
TransitionModelMappingSparse
*
Clone
()
const
92
{
return
new
TransitionModelMappingSparse
(*
this
); }
93
94
friend
class
TGet_TransitionModelMappingSparse
;
95
96
};
97
98
#endif
/* !_TRANSITIONMODELMAPPINGSPARSE_H_ */
99
100
101
// Local Variables: ***
102
// mode:c++ ***
103
// End: ***
src
base
TransitionModelMappingSparse.h
Generated on Mon Sep 23 2013 14:50:05 for MultiAgentDecisionProcess by
1.8.1.2