COPASI API  4.16.103
CInterpolation.h
Go to the documentation of this file.
1 
2 #ifndef CINTERPOLATION
3 #define CINTERPOLATION
4 #include "copasi.h"
8 
9 #include <vector>
10 #include <set>
11 #include <cstdlib>
12 
13 /*************************/
14 /* Class of CStateRecord */
15 /*************************/
17 {
18 
19 //**Member Functions*************************************************
20  public:
21 
22  /**
23  * Friend Function for Debug
24  */
25  friend void printRecord(const CStateRecord& record);
26 
27 
28  /**
29  * Constructor
30  */
31  CStateRecord();
32 
33  /**
34  * Assignment Constructor
35  */
36  CStateRecord(size_t reactionNum);
37 
38 
39  /**
40  * Copy constructor
41  * @param const CStateRecord & src
42  */
43  CStateRecord(const CStateRecord & src);
44 
45  /**
46  * Destructor
47  */
48  ~CStateRecord();
49 
50  /**
51  * Assignment operator
52  * @param const CStateRecord & rhs
53  * @return CStateRecord & lhs
54  */
55  CStateRecord & operator=(const CStateRecord & rhs);
56 
57  /**
58  * Retrieve the pointer of the C_FLOAT64 array recording all
59  * the values,
60  * @return const C_FLOAT64 *mpValue
61  */
62  C_FLOAT64 * getArray() const;
63 
64  /**
65  * Retrive the time of the state
66  * @return const C_FLOAT64 & mpValue(0)
67  */
68  const C_FLOAT64 & getTime() const;
69 
70  /**
71  * Retrieve the Sum of Slow Reaction Propensities
72  * @return const C_FLOAT64 & mpValue(mSize-1)
73  */
74  const C_FLOAT64 & getSlowPropensitySum() const;
75 
76  /**
77  * Retrieve the attibute mSize, the length of the array
78  */
79  const size_t & getArrayLen() const;
80 
81 //**Attributes********************************************
82 
83  private:
84  /**
85  * Array of values
86  */
88 
89  /**
90  * Size of array
91  */
92  size_t mSize;
93 
94 };
95 
96 
97 
98 /***************************/
99 /* Class of CInterpolation */
100 /***************************/
101 
103 {
104 
105  //********Member Functions********
106  public:
107  /**
108  * Friend Function for Debug
109  */
110  friend void printInterpolation(const CInterpolation& interp);
111 
112  /**
113  * Default Constructor
114  */
115  CInterpolation();
116 
117  /**
118  * Assignment Constructor
119  */
120  CInterpolation(size_t stateNum, size_t reactionNum);
121 
122  /**
123  * Destructor
124  */
125  ~CInterpolation();
126 
127  /**
128  * Retrieve the model State at the
129  * slow reaction firing time by call
130  * calculateFiringTime() and
131  * calculateState()
132  * @return CStateRecord mInterpolationState
133  */
135 
136  /**
137  * Reset the record
138  */
139  void recordReset();
140 
141  /**
142  * Load the New State
143  * @para const C_FLOAT64 time, const unsigned C_INT32 len
144  * const C_FLOAT54 *y
145  */
146  void recordState(const C_FLOAT64 time,
147  const C_FLOAT64 *y);
148 
149  private:
150  /**
151  * Calculate Interpolation Value
152  * @param C_FLOAT64 x
153  */
155 
156  /**
157  * Calculate time when slow reaction fires
158  */
159  void calculateFiringTime();
160 
161  /**
162  * Calculate Model State at event time
163  */
164  void calculateState();
165 
166  //********Member Attributes********
167  private:
168  /**
169  * Pointer to an array of class CStateRecord
170  */
172 
173  /**
174  * A pointer of CStateRecord Object recording the state
175  * of model at slow reaction firing time calculated
176  * by interpolation
177  */
179 
180  /**
181  * A C_FLOAT64 pointer for interpolation array x
182  */
184 
185  /**
186  * A C_FLOAT64 pointer for interpolation array y
187  */
189 
190  /**
191  * Length of Vector mState
192  */
193  size_t mStateNum;
194 
195  /**
196  * An integer index indicating which state is the
197  * first available one for interpolation
198  */
200 
201  /**
202  * An integer indicating how many state has been recorded
203  */
205 
206  /**
207  * A Bool variable indicating whether the mBeginRecordIndex
208  * should be shift
209  */
211 };
212 
213 #endif
CStateRecord * mpInterpolationState
CStateRecord & operator=(const CStateRecord &rhs)
void recordState(const C_FLOAT64 time, const C_FLOAT64 *y)
CStateRecord * mpState
size_t mBeginRecordIndex
const C_FLOAT64 & getSlowPropensitySum() const
void calculateFiringTime()
C_FLOAT64 interpolation(C_FLOAT64 x)
C_FLOAT64 * getArray() const
const C_FLOAT64 & getTime() const
CStateRecord * getInterpolationState()
C_FLOAT64 * mpY
#define C_FLOAT64
Definition: copasi.h:92
friend void printRecord(const CStateRecord &record)
friend void printInterpolation(const CInterpolation &interp)
C_FLOAT64 * mpValues
C_FLOAT64 * mpX
const size_t & getArrayLen() const