COPASI API  4.16.103
CSteadyStateProblem.cpp
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/steadystate/CSteadyStateProblem.cpp,v $
3  $Revision: 1.28 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2010/02/11 19:42:49 $
7  End CVS Header */
8 
9 // Copyright (C) 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 /**
24  * CSteadyStateProblem class.
25  * This class describes the steady state problem, i.e., it allows to specify
26  * for example initial conditions.
27  *
28  * Created for Copasi by Stefan Hoops 2002
29  */
30 
31 #include <string>
32 
33 #include "copasi.h"
34 #include "CSteadyStateProblem.h"
35 
38 #include "model/CModel.h"
39 
40 /**
41  * Default constructor.
42  */
44  CCopasiProblem(CCopasiTask::steadyState, pParent)
45  //mInitialState(),
46  //mHasInitialState(false)
47 {
48  addParameter("JacobianRequested", CCopasiParameter::BOOL, true);
49  addParameter("StabilityAnalysisRequested", CCopasiParameter::BOOL, true);
51 }
52 
53 /**
54  * Copy constructor.
55  * @param "const CSteadyStateProblem &" src
56  */
58  const CCopasiContainer * pParent):
59  CCopasiProblem(src, pParent)
60  //mInitialState(src.mInitialState),
61  //mHasInitialState(src.mHasInitialState)
63 
64 /**
65  * Destructor.
66  */
69 
71 {
72  if (!mpModel) return false;
73 
74  return true;
75 }
76 
77 /**
78  * Set whether the jacobian is requested.
79  * @param bool * jacobianRequested
80  */
81 void CSteadyStateProblem::setJacobianRequested(bool & jacobianRequested)
82 {setValue("JacobianRequested", jacobianRequested);}
83 
84 /**
85  * Retrieve whether the jacobian is requested.
86  * @return bool jacobianRequested
87  */
89 {return * getValue("JacobianRequested").pBOOL;}
90 
91 /**
92  * Set whether stabilty analysis is requested.
93  * @param bool * stabilityAnalysisRequested
94  */
95 void CSteadyStateProblem::setStabilityAnalysisRequested(bool & stabilityAnalysisRequested)
96 {setValue("StabilityAnalysisRequested", stabilityAnalysisRequested);}
97 
98 /**
99  * Retrieve whether the stabilty analysis is requested.
100  * @return bool stabilityAnalysisRequested
101  */
103 {return * getValue("StabilityAnalysisRequested").pBOOL;}
104 
105 /**
106  * Load a steadystate problem
107  * @param "CReadConfig &" configBuffer
108  */
111 {
112  if (configBuffer.getVersion() < "4.0")
113  {
114  CCopasiDataModel* pDataModel = getObjectDataModel();
115  assert(pDataModel != NULL);
116  mpModel = pDataModel->getModel();
117  //mInitialState = mpModel->getInitialState();
118  //mHasInitialState = false;
119  configBuffer.getVariable("RepStabilityAnalysis", "bool" ,
120  getValue("StabilityAnalysisRequested").pBOOL,
122  setValue("JacobianRequested",
123  * getValue("StabilityAnalysisRequested").pBOOL);
124  }
125 }
CCopasiDataModel * getObjectDataModel()
bool isStabilityAnalysisRequested() const
std::string getVersion()
Definition: CReadConfig.cpp:76
#define C_UNUSED(p)
Definition: copasi.h:220
void load(CReadConfig &configBuffer, CReadConfig::Mode mode=CReadConfig::NEXT)
#define DESTRUCTOR_TRACE
Definition: copasi.h:206
void setJacobianRequested(bool &jacobianRequested)
const Value & getValue() const
bool setValue(const std::string &name, const CType &value)
CSteadyStateProblem(const CCopasiContainer *pParent=NULL)
bool addParameter(const CCopasiParameter &parameter)
void setStabilityAnalysisRequested(bool &stabilityAnalysisRequested)
C_INT32 getVariable(const std::string &name, const std::string &type, void *pout, CReadConfig::Mode mode=CReadConfig::NEXT)
Definition: CReadConfig.cpp:81
CModel * mpModel
bool isJacobianRequested() const
#define CONSTRUCTOR_TRACE
Definition: copasi.h:202