COPASI API  4.16.103
CMCAMethod.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef COPASI_CMCAMethod_H__
16 #define COPASI_CMCAMethod_H__
17 
18 #include <vector>
19 #include "utilities/CLinkMatrix.h"
23 
24 class CModel;
25 class CSteadyStateTask;
26 
28 {
29 public:
30  /**
31  * Create a MCA method.
32  * Note: the returned object has to be released after use with delete
33  */
35 
36  /**
37  * Default constructor
38  * @param const CCopasiContainer * pParent (Default: NULL)
39  */
40  CMCAMethod(const CCopasiContainer * pParent = NULL);
41 
42  /**
43  * Copy constructor
44  * @param const CMCAMethod & src
45  * @param const CCopasiContainer * pParent (Default: NULL)
46  */
47  CMCAMethod(const CMCAMethod & src,
48  const CCopasiContainer * pParent = NULL);
49 
50  /**
51  * Destructor
52  */
53  virtual ~CMCAMethod();
54 
55  /**
56  * This methods must be called to elevate subgroups to
57  * derived objects. The default implementation does nothing.
58  * @return bool success
59  */
60  virtual bool elevateChildren();
61 
63  {return mUnscaledElasticities;}
64 
66 
68  {return mUnscaledConcCC;}
69 
71 
73  {return mUnscaledFluxCC;}
74 
75  bool calculateUnscaledFluxCC(const bool & status);
76 
78  {return mScaledElasticities;}
79 
81  {return mScaledConcCC;}
82 
84  {return mScaledFluxCC;}
85 
87  {return mUnscaledElasticitiesAnn;}
89  {return mScaledElasticitiesAnn;}
91  {return mUnscaledConcCCAnn;}
93  {return mScaledConcCCAnn;}
95  {return mUnscaledFluxCCAnn;}
97  {return mScaledFluxCCAnn;}
98 
99  /**
100  * Resizes all result matrices and updates the corresponding array annotations.
101  * This needs to be called before output initialization (in case the output references
102  * parts of the matrix) from the task initialization, but it also needs to be called
103  * before selecting elements of the matrices in the object selection dialog.
104  * The model needs to be set before calling this.
105  */
106  virtual void resizeAllMatrices();
107 
108  /**
109  * Scales the coefficients (i.e. Kacser format, rather than Reder)
110  */
111  bool scaleMCA(const bool & status, C_FLOAT64 res);
112 
113  /**
114  * Check whether the summation theorems hold.
115  */
116  bool checkSummationTheorems(const C_FLOAT64 & resolution);
117 
118  /**
119  * Set the Model
120  */
121  void setModel(CModel* model);
122 
123  /**
124  * Get the Model
125  */
126  const CModel* getModel() const;
127 
128  /**
129  * the steady state MCA entry point
130  * @param ss_solution refer to steady-state solution
131  * @param refer to the resolution
132  */
133  bool CalculateMCA(C_FLOAT64 res);
134 
135  /**
136  *
137  */
138  virtual bool process();
139 
140  /**
141  * Read SSMCAUnscaled from configuration file
142  */
143  C_INT32 load(CReadConfig & configBuffer);
144 
145  void setSteadyStateTask(CSteadyStateTask * pSteadyStateTask);
146 
148  {return mSSStatus;}
149 
150  void setFactor(C_FLOAT64 factor);
151 
152  void setSteadyStateResolution(C_FLOAT64 factor);
153 
154  /**
155  * Check if the method is suitable for this problem
156  * @return bool suitability of the method
157  */
158  virtual bool isValidProblem(const CCopasiProblem * pProblem);
159 
160 private:
161  void initObjects();
162 
163  /**
164  * Initialize the method parameter
165  */
166  void initializeParameter();
167 
168  bool createLinkMatrix(const bool & useSmallbone = false);
169 
170 private:
171 
173 
174  bool * mpUseReeder;
175 
177 
178  /**
179  * MCA Matrices
180  */
183 
186 
189 
192 
195 
198 
199  /**
200  * 1 if MCA coeffs are to be unscaled
201  */
203 
204  /**
205  * If need to evaluate the elasticities, ss_x
206  * will be assigned in calculateTimeMCA()
207  */
208  std::vector <C_FLOAT64> mSsx;
209 
210  /**
211  * Modulation factor for finite differences derivation
212  */
214 
216 
218 
220 
222 
224 
226 };
227 #endif // COPASI_CMca
const CArrayAnnotation * getUnscaledFluxCCAnn() const
Definition: CMCAMethod.h:94
CArrayAnnotation * mScaledElasticitiesAnn
Definition: CMCAMethod.h:191
CMatrix< C_FLOAT64 > mUnscaledConcCC
Definition: CMCAMethod.h:184
const CArrayAnnotation * getScaledConcentrationCCAnn() const
Definition: CMCAMethod.h:92
bool CalculateMCA(C_FLOAT64 res)
Definition: CMCAMethod.cpp:673
CSteadyStateMethod::ReturnCode mSSStatus
Definition: CMCAMethod.h:217
void setSteadyStateTask(CSteadyStateTask *pSteadyStateTask)
Definition: CMCAMethod.cpp:773
CMatrix< C_FLOAT64 > mScaledElasticities
Definition: CMCAMethod.h:190
CSteadyStateTask * mpSteadyStateTask
Definition: CMCAMethod.h:219
CLinkMatrix mLinkZero
Definition: CMCAMethod.h:221
CArrayAnnotation * mScaledConcCCAnn
Definition: CMCAMethod.h:194
CMatrix< C_FLOAT64 > mUnscaledFluxCC
Definition: CMCAMethod.h:187
const CMatrix< C_FLOAT64 > & getUnscaledElasticities() const
Definition: CMCAMethod.h:62
void initObjects()
Definition: CMCAMethod.cpp:77
CArrayAnnotation * mScaledFluxCCAnn
Definition: CMCAMethod.h:197
#define C_INT32
Definition: copasi.h:90
virtual void resizeAllMatrices()
Definition: CMCAMethod.cpp:160
virtual ~CMCAMethod()
Definition: CMCAMethod.cpp:132
virtual bool elevateChildren()
Definition: CMCAMethod.cpp:154
bool scaleMCA(const bool &status, C_FLOAT64 res)
Definition: CMCAMethod.cpp:440
void setSteadyStateResolution(C_FLOAT64 factor)
Definition: CMCAMethod.cpp:792
const CModel * getModel() const
Definition: CMCAMethod.cpp:797
virtual bool isValidProblem(const CCopasiProblem *pProblem)
Definition: CMCAMethod.cpp:803
bool checkSummationTheorems(const C_FLOAT64 &resolution)
Definition: CMCAMethod.cpp:598
const CSteadyStateMethod::ReturnCode & getSteadyStateStatus() const
Definition: CMCAMethod.h:147
CMatrix< C_FLOAT64 > mScaledConcCC
Definition: CMCAMethod.h:193
bool createLinkMatrix(const bool &useSmallbone=false)
Definition: CMCAMethod.cpp:718
const CArrayAnnotation * getUnscaledConcentrationCCAnn() const
Definition: CMCAMethod.h:90
const CArrayAnnotation * getScaledElasticitiesAnn() const
Definition: CMCAMethod.h:88
virtual bool process()
Definition: CMCAMethod.cpp:757
const CArrayAnnotation * getScaledFluxCCAnn() const
Definition: CMCAMethod.h:96
const CMatrix< C_FLOAT64 > & getUnscaledConcentrationCC() const
Definition: CMCAMethod.h:67
void setFactor(C_FLOAT64 factor)
Definition: CMCAMethod.cpp:787
#define C_INT16
Definition: copasi.h:91
CMatrix< C_FLOAT64 > mReducedStoichiometry
Definition: CMCAMethod.h:223
bool * mpUseSmallbone
Definition: CMCAMethod.h:176
CMatrix< bool > mElasticityDependencies
Definition: CMCAMethod.h:225
CArrayAnnotation * mUnscaledElasticitiesAnn
Definition: CMCAMethod.h:182
void calculateUnscaledElasticities(C_FLOAT64 res)
Definition: CMCAMethod.cpp:203
CMatrix< C_FLOAT64 > mUnscaledElasticities
Definition: CMCAMethod.h:181
Header file of class CArrayAnnotation.
void setModel(CModel *model)
Definition: CMCAMethod.cpp:663
#define C_FLOAT64
Definition: copasi.h:92
const CMatrix< C_FLOAT64 > & getUnscaledFluxCC() const
Definition: CMCAMethod.h:72
const CArrayAnnotation * getUnscaledElasticitiesAnn() const
Definition: CMCAMethod.h:86
CArrayAnnotation * mUnscaledConcCCAnn
Definition: CMCAMethod.h:185
CMCAMethod(const CCopasiContainer *pParent=NULL)
Definition: CMCAMethod.cpp:42
C_INT32 load(CReadConfig &configBuffer)
Definition: CMCAMethod.cpp:745
static CMCAMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::mcaMethodReder)
Definition: CMCAMethod.cpp:34
Definition: CModel.h:50
CModel * mpModel
Definition: CMCAMethod.h:172
CArrayAnnotation * mUnscaledFluxCCAnn
Definition: CMCAMethod.h:188
CMatrix< C_FLOAT64 > mScaledFluxCC
Definition: CMCAMethod.h:196
const CMatrix< C_FLOAT64 > & getScaledConcentrationCC() const
Definition: CMCAMethod.h:80
void initializeParameter()
Definition: CMCAMethod.cpp:138
bool * mpUseReeder
Definition: CMCAMethod.h:174
const CMatrix< C_FLOAT64 > & getScaledElasticities() const
Definition: CMCAMethod.h:77
C_FLOAT64 mSteadyStateResolution
Definition: CMCAMethod.h:215
std::vector< C_FLOAT64 > mSsx
Definition: CMCAMethod.h:208
bool calculateUnscaledConcentrationCC()
Definition: CMCAMethod.cpp:311
C_INT16 mSSReder
Definition: CMCAMethod.h:202
C_FLOAT64 mFactor
Definition: CMCAMethod.h:213
const CMatrix< C_FLOAT64 > & getScaledFluxCC() const
Definition: CMCAMethod.h:83
bool calculateUnscaledFluxCC(const bool &status)
Definition: CMCAMethod.cpp:403