COPASI API  4.16.103
Public Member Functions | Private Member Functions | Friends | List of all members
CLNATask Class Reference

#include <CLNATask.h>

Inheritance diagram for CLNATask:
Inheritance graph
[legend]
Collaboration diagram for CLNATask:
Collaboration graph
[legend]

Public Member Functions

 CLNATask (const CCopasiContainer *pParent=NULL)
 
 CLNATask (const CLNATask &src, const CCopasiContainer *pParent=NULL)
 
virtual CCopasiMethodcreateMethod (const int &type) const
 
virtual bool initialize (const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
 
void load (CReadConfig &configBuffer)
 
void printResult (std::ostream *ostream) const
 
virtual bool process (const bool &useInitialValues)
 
virtual bool restore ()
 
virtual bool updateMatrices ()
 
virtual ~CLNATask ()
 
- Public Member Functions inherited from CCopasiTask
 CCopasiTask (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
 
 CCopasiTask (const Type &taskType, const CCopasiContainer *pParent=NULL, const std::string &type="Task")
 
 CCopasiTask (const CCopasiTask &src, const CCopasiContainer *pParent=NULL)
 
void cleanup ()
 
CProcessReportgetCallBack () const
 
const CDescriptiongetDescription () const
 
virtual const std::string & getKey () const
 
CCopasiMethodgetMethod ()
 
const CCopasiMethodgetMethod () const
 
COutputHandlergetOutputHandler () const
 
const OutputFlaggetOutputMode () const
 
CCopasiProblemgetProblem ()
 
const CCopasiProblemgetProblem () const
 
CReportgetReport ()
 
const CResultgetResult () const
 
CCopasiParameterGroupgetSliders ()
 
Type getType () const
 
const bool & isScheduled () const
 
const bool & isUpdateModel () const
 
virtual void output (const COutputInterface::Activity &activity)
 
virtual void separate (const COutputInterface::Activity &activity)
 
virtual bool setCallBack (CProcessReport *pCallBack)
 
virtual bool setMethodType (const int &type)
 
void setScheduled (const bool &scheduled)
 
void setType (const Type &type)
 
void setUpdateModel (const bool &updateModel)
 
virtual ~CCopasiTask ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual CCopasiObjectName getCN () const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
virtual voidgetValuePointer () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
virtual void print (std::ostream *ostream) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Member Functions

void cleanup ()
 

Friends

std::ostream & operator<< (std::ostream &os, const CLNATask &A)
 

Additional Inherited Members

- Public Types inherited from CCopasiTask
enum  eOutputFlagBase {
  INITIALIZE = 0x01, STREAM = 0x02, FINISH = 0x04, REPORT = 0x10,
  PLOT = 0x20, TIME_SERIES = 0x40
}
 
enum  OutputFlag {
  NO_OUTPUT = 0, OUTPUT_BEFORE = INITIALIZE, OUTPUT_AFTER = FINISH, OUTPUT = REPORT | PLOT | STREAM,
  OUTPUT_SE = REPORT | PLOT | INITIALIZE | STREAM | FINISH, OUTPUT_UI = REPORT | PLOT | TIME_SERIES | INITIALIZE | STREAM | FINISH, ONLY_TIME_SERIES = TIME_SERIES | INITIALIZE | STREAM | FINISH
}
 
enum  Type {
  steadyState = 0, timeCourse, scan, fluxMode,
  optimization, parameterFitting, mca, lyap,
  tssAnalysis, sens, moieties, crosssection,
  lna, unset
}
 
- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiTask
static bool isValidMethod (const unsigned int &method, const unsigned int *validMethods)
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Public Attributes inherited from CCopasiTask
std::string Error
 
std::string Warning
 
- Static Public Attributes inherited from CCopasiTask
static const std::string TypeName []
 
static const unsigned int ValidMethods []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiTask
CDescription mDescription
 
OutputFlag mDoOutput
 
std::string mKey
 
unsigned C_INT32 mOutputCounter
 
CProcessReportmpCallBack
 
CStatempInitialState
 
CCopasiMethodmpMethod
 
COutputHandlermpOutputHandler
 
CCopasiProblemmpProblem
 
CCopasiParameterGroupmpSliders
 
CReport mReport
 
CResult mResult
 
bool mScheduled
 
Type mType
 
bool mUpdateModel
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 38 of file CLNATask.h.

Constructor & Destructor Documentation

CLNATask::CLNATask ( const CCopasiContainer pParent = NULL)

Default constructor

Parameters
constCCopasiContainer * pParent (default: NULL)

Definition at line 30 of file CLNATask.cpp.

References CCopasiContainer::add(), createMethod(), CCopasiMethod::linearNoiseApproximation, CCopasiTask::mpMethod, and CCopasiTask::mpProblem.

30  :
32 {
33  mpProblem = new CLNAProblem(this);
34 
36  this->add(mpMethod, true);
37 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
CCopasiTask(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CLNATask.cpp:54
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CLNATask::CLNATask ( const CLNATask src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
constCLNATask & src
constCCopasiContainer * pParent (default: NULL)

Definition at line 39 of file CLNATask.cpp.

References CCopasiContainer::add(), createMethod(), CCopasiMethod::getSubType(), CCopasiTask::mpMethod, and CCopasiTask::mpProblem.

40  :
41  CCopasiTask(src, pParent)
42 {
43  mpProblem =
44  new CLNAProblem(*(CLNAProblem *) src.mpProblem, this);
45 
47  this->add(mpMethod, true);
48 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
CCopasiTask(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
const CCopasiMethod::SubType & getSubType() const
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CLNATask.cpp:54
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CLNATask::~CLNATask ( )
virtual

Destructor

Definition at line 50 of file CLNATask.cpp.

51 {}

Member Function Documentation

void CLNATask::cleanup ( )
private

cleanup()

Definition at line 61 of file CLNATask.cpp.

62 {}
CCopasiMethod * CLNATask::createMethod ( const int &  type) const
virtual

Create a method of the specified type to solve the task. It is the duty of the caller to release the CCopasiMethod.

Parameters
constCCopasiMethod::SubType & type
Returns
CCopasiMethod *

Reimplemented from CCopasiTask.

Definition at line 54 of file CLNATask.cpp.

References CLNAMethod::createMethod().

Referenced by CLNATask().

55 {
57 
58  return CLNAMethod::createMethod(Type);
59 }
static CLNAMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::linearNoiseApproximation)
Definition: CLNAMethod.cpp:21
bool CLNATask::initialize ( const OutputFlag of,
COutputHandler pOutputHandler,
std::ostream *  pOstream 
)
virtual

Initialize the task. If an ostream is given this ostream is used instead of the target specified in the report. This allows nested tasks to share the same output device.

Parameters
constOutputFlag & of
COutputHandler* pOutputHandler
std::ostream* pOstream (default: NULL)
Returns
bool success

Reimplemented from CCopasiTask.

Definition at line 94 of file CLNATask.cpp.

References CModel::compileIfNecessary(), CCopasiProblem::getModel(), CReport::getStream(), CLNAProblem::getSubTask(), CSteadyStateTask::initialize(), CCopasiTask::initialize(), CCopasiMethod::isValidProblem(), CCopasiTask::mpCallBack, CCopasiTask::mpMethod, CCopasiTask::mpProblem, CCopasiTask::mReport, CCopasiTask::NO_OUTPUT, and updateMatrices().

97 {
98  assert(mpProblem && mpMethod);
99 
100  CLNAProblem* pProblem =
101  dynamic_cast<CLNAProblem *>(mpProblem);
102  assert(pProblem);
103 
104  if (!mpMethod->isValidProblem(mpProblem)) return false;
105 
106  //we need to resize and initialize the result matrices before initializing the output
107  if (!updateMatrices()) return false;
108 
109  bool success = true;
110 
111  //initialize reporting
112  if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false;
113 
114  if (!pProblem->getModel()->compileIfNecessary(mpCallBack)) success = false;
115 
116  CSteadyStateTask *pSubTask = pProblem->getSubTask();
117 
118  if (pSubTask)
119  success = pSubTask->initialize(CCopasiTask::NO_OUTPUT, NULL, mReport.getStream());
120 
121  return success;
122 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
CReport mReport
Definition: CCopasiTask.h:244
virtual bool isValidProblem(const CCopasiProblem *pProblem)
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool updateMatrices()
Definition: CLNATask.cpp:74
std::ostream * getStream() const
Definition: CReport.cpp:392
CSteadyStateTask * getSubTask() const
bool compileIfNecessary(CProcessReport *pProcessReport)
Definition: CModel.cpp:612
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
CModel * getModel() const
void CLNATask::load ( CReadConfig configBuffer)

Loads parameters for this solver with data coming from a CReadConfig object. (CReadConfig object reads an input stream)

Parameters
configbufferreference to a CReadConfig object.

Definition at line 64 of file CLNATask.cpp.

References CReadConfig::getVariable(), CReadConfig::LOOP, CCopasiTask::mpMethod, CCopasiTask::mpProblem, and CCopasiTask::mScheduled.

65 {
66  configBuffer.getVariable("LNA", "bool", &mScheduled,
68 
69  ((CLNAProblem *) mpProblem)->load(configBuffer);
70 
71  ((CLNAMethod *) mpMethod)->load(configBuffer);
72 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
bool mScheduled
Definition: CCopasiTask.h:217
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
C_INT32 getVariable(const std::string &name, const std::string &type, void *pout, CReadConfig::Mode mode=CReadConfig::NEXT)
Definition: CReadConfig.cpp:81
void CLNATask::printResult ( std::ostream *  ostream) const

This functionality is expected from the problem but has to be implemented here for the moment. This is called from the corresponding method of the problem

Definition at line 215 of file CLNATask.cpp.

References CSteadyStateMethod::found, CSteadyStateMethod::foundEquilibrium, CSteadyStateMethod::foundNegative, CLNAMethod::getCovarianceMatrixAnn(), CCopasiProblem::getModel(), CLNAMethod::getSteadyStateStatus(), CLNAProblem::getSubTask(), CLNAProblem::isSteadyStateRequested(), CCopasiTask::mpMethod, CCopasiTask::mpProblem, CSteadyStateMethod::notFound, and CLNAMethod::setModel().

Referenced by CLNAProblem::printResult().

216 {
217  assert(mpProblem && mpMethod);
218 
219  CLNAProblem* pProblem =
220  dynamic_cast<CLNAProblem *>(mpProblem);
221  assert(pProblem);
222 
223  CLNAMethod* pMethod = dynamic_cast<CLNAMethod *>(mpMethod);
224  assert(pMethod);
225  pMethod->setModel(mpProblem->getModel());
226 
227  std::ostream & os = *ostream;
228 
229  bool showSS = false; //show Steady State result?
230 
231  if (pProblem->isSteadyStateRequested())
232  {
234  {
235  os << "A steady state was found. All coefficients are shown." << std::endl;
236  showSS = true;
237  }
238 
240  {
241  os << "An equilibrium steady state was found. All coefficients are shown." << std::endl;
242  showSS = true;
243  }
244 
246  {
247  os << "Invalid steady state found (negative concentrations)." << std::endl;
248  showSS = true;
249  }
250 
252  {
253  os << "No steady state found." << std::endl;
254  }
255  }
256  else
257  {
258  os << "No steady state calculation was requested." << std::endl;
259  }
260 
261  os << std::endl;
262  os << *pMethod->getCovarianceMatrixAnn() << std::endl;
263 
264  if (showSS)
265  {
266  if (!pProblem->getSubTask())
267  {
268  os << "Problem with steady state calculation. Please report as bug!" << std::endl;
269  return;
270  }
271 
272  os << "Results of the steady state subtask (the state for which the LNA was performed):" << std::endl;
273  os << *pProblem->getSubTask();
274  }
275 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
const CSteadyStateMethod::ReturnCode & getSteadyStateStatus() const
Definition: CLNAMethod.h:185
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const CArrayAnnotation * getCovarianceMatrixAnn() const
Definition: CLNAMethod.h:110
CSteadyStateTask * getSubTask() const
void setModel(CModel *model)
Definition: CLNAMethod.cpp:591
bool isSteadyStateRequested() const
CModel * getModel() const
bool CLNATask::process ( const bool &  useInitialValues)
virtual

Process the task with or without initializing to the initial state.

Parameters
constbool & useInitialValues
Returns
bool success

Reimplemented from CCopasiTask.

Definition at line 124 of file CLNATask.cpp.

References COutputInterface::AFTER, CLNAMethod::allNeg, CModel::applyInitialValues(), COutputInterface::BEFORE, COutputInterface::DURING, CSteadyStateMethod::found, CSteadyStateMethod::foundEquilibrium, CSteadyStateTask::getEigenValuesReduced(), CCopasiProblem::getModel(), CEigen::getNimag(), CEigen::getNposreal(), CEigen::getNzero(), CCopasiTask::getProblem(), CSteadyStateTask::getResult(), CCopasiTask::mpCallBack, CCopasiTask::mpMethod, CCopasiTask::mpProblem, CLNAMethod::nonNegEigenvaluesExist, CSteadyStateMethod::notFound, CCopasiTask::output(), CSteadyStateTask::process(), CLNAMethod::process(), CCopasiTask::setCallBack(), CLNAMethod::setEigenValueStatus(), CSteadyStateProblem::setStabilityAnalysisRequested(), and CLNAMethod::setSteadyStateStatus().

125 {
126  bool success = true;
127  bool stabilityAnalysisRequested = true;
128 
129  assert(mpMethod);
130 
131  CLNAMethod* pMethod = dynamic_cast<CLNAMethod *>(mpMethod);
132  assert(pMethod);
133 
134  CSteadyStateTask *pSubTask =
135  dynamic_cast<CLNAProblem *>(mpProblem)->getSubTask();
136 
137  if (pSubTask)
138  {
139  // LNA needs the calculation of stability information
140  CSteadyStateProblem* pSSProblem = dynamic_cast<CSteadyStateProblem *>(pSubTask->getProblem());
141  assert(pSSProblem);
142  pSSProblem->setStabilityAnalysisRequested(stabilityAnalysisRequested);
143 
144  pSubTask->setCallBack(mpCallBack);
145  pSubTask->process(useInitialValues);
146  CSteadyStateMethod::ReturnCode SSstatus = pSubTask->getResult();
147  pMethod->setSteadyStateStatus(SSstatus);
148  success &= ((SSstatus == CSteadyStateMethod::found) || (SSstatus == CSteadyStateMethod::foundEquilibrium));
149 
150  if (!success && useInitialValues)
151  {
153  }
154 
155  // check for positive or zero Eigen values
156  if (success)
157  {
158  const CEigen &mEigenReduced = pSubTask->getEigenValuesReduced();
159 
160  if ((mEigenReduced.getNposreal() + mEigenReduced.getNimag() + mEigenReduced.getNzero()) > 0)
161  {
163  success = false;
164  }
165  else
166  {
168  }
169  }
170  }
171  else
172  {
174 
175  if (useInitialValues)
176  {
178  }
179 
180  success = false;
181  }
182 
184 
185  success &= pMethod->process();
186 
189 
190  return success;
191 }
virtual bool setCallBack(CProcessReport *pCallBack)
const CSteadyStateMethod::ReturnCode & getResult() const
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual bool process(const bool &useInitialValues)
CCopasiProblem * getProblem()
Definition: CEigen.h:36
virtual bool process()
Definition: CLNAMethod.cpp:636
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
virtual void output(const COutputInterface::Activity &activity)
void setEigenValueStatus(CLNAMethod::EVStatus status)
Definition: CLNAMethod.cpp:647
void applyInitialValues()
Definition: CModel.cpp:1236
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const size_t & getNimag() const
Definition: CEigen.cpp:661
const size_t & getNposreal() const
Definition: CEigen.cpp:674
const CEigen & getEigenValuesReduced() const
void setSteadyStateStatus(CSteadyStateMethod::ReturnCode SSStatus)
Definition: CLNAMethod.cpp:642
void setStabilityAnalysisRequested(bool &stabilityAnalysisRequested)
const size_t & getNzero() const
Definition: CEigen.cpp:208
CModel * getModel() const
bool CLNATask::restore ( )
virtual

Perform neccessary cleanup procedures

Reimplemented from CCopasiTask.

Definition at line 193 of file CLNATask.cpp.

References CCopasiTask::mpProblem, CSteadyStateTask::restore(), and CCopasiTask::restore().

194 {
195  bool success = CCopasiTask::restore();
196 
197  CSteadyStateTask *pSubTask =
198  dynamic_cast<CLNAProblem *>(mpProblem)->getSubTask();
199 
200  if (pSubTask)
201  success &= pSubTask->restore();
202 
203  return success;
204 }
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool restore()
virtual bool restore()
bool CLNATask::updateMatrices ( )
virtual

Resizes result matrices and updates array annotations for a specific task. This is used when we need to know about the data structures of a task result without actually performing the task, e.g. when selecting objects for output. For now we assume that this functionality is also performed when initialize() is called.

Reimplemented from CCopasiTask.

Definition at line 74 of file CLNATask.cpp.

References CCopasiProblem::getModel(), CCopasiMethod::isValidProblem(), CCopasiTask::mpMethod, CCopasiTask::mpProblem, CLNAMethod::resizeAllMatrices(), and CLNAMethod::setModel().

Referenced by initialize().

75 {
76  assert(mpProblem && mpMethod);
77 
78  CLNAProblem* pProblem =
79  dynamic_cast<CLNAProblem *>(mpProblem);
80  assert(pProblem);
81 
82  if (!mpMethod->isValidProblem(pProblem)) return false;
83 
84  CLNAMethod * pMethod = dynamic_cast<CLNAMethod*>(mpMethod);
85 
86  if (!pMethod) return false;
87 
88  pMethod->setModel(mpProblem->getModel());
89  pMethod->resizeAllMatrices();
90 
91  return true;
92 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual void resizeAllMatrices()
Definition: CLNAMethod.cpp:107
virtual bool isValidProblem(const CCopasiProblem *pProblem)
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
void setModel(CModel *model)
Definition: CLNAMethod.cpp:591
CModel * getModel() const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CLNATask A 
)
friend

The documentation for this class was generated from the following files: