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

#include <CMCATask.h>

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

Public Member Functions

 CMCATask (const CCopasiContainer *pParent=NULL)
 
 CMCATask (const CMCATask &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 ~CMCATask ()
 
- 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 CMCATask &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 46 of file CMCATask.h.

Constructor & Destructor Documentation

CMCATask::CMCATask ( const CCopasiContainer pParent = NULL)

A pointer to the found elasticities A pointer to the found flux control coefficients. A pointer to the found concentration control coefficients. Default constructor

Parameters
constCCopasiContainer * pParent (default: NULL)

Definition at line 40 of file CMCATask.cpp.

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

40  :
42 {
43  mpProblem = new CMCAProblem(this);
44 
46  this->add(mpMethod, true);
47 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CMCATask.cpp:64
CCopasiTask(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CMCATask::CMCATask ( const CMCATask src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

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

Definition at line 49 of file CMCATask.cpp.

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

50  :
51  CCopasiTask(src, pParent)
52 {
53  mpProblem =
54  new CMCAProblem(*(CMCAProblem *) src.mpProblem, this);
55 
57  this->add(mpMethod, true);
58 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CMCATask.cpp:64
CCopasiTask(const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const std::string &type="Task")
const CCopasiMethod::SubType & getSubType() const
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CMCATask::~CMCATask ( )
virtual

Destructor

Definition at line 60 of file CMCATask.cpp.

61 {}

Member Function Documentation

void CMCATask::cleanup ( )
private

cleanup()

Definition at line 71 of file CMCATask.cpp.

72 {}
CCopasiMethod * CMCATask::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 64 of file CMCATask.cpp.

References CMCAMethod::createMethod().

Referenced by CMCATask().

65 {
67 
68  return CMCAMethod::createMethod(Type);
69 }
static CMCAMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::mcaMethodReder)
Definition: CMCAMethod.cpp:34
bool CMCATask::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 102 of file CMCATask.cpp.

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

105 {
106  assert(mpProblem && mpMethod);
107 
108  CMCAProblem* pProblem =
109  dynamic_cast<CMCAProblem *>(mpProblem);
110  assert(pProblem);
111 
112  if (!mpMethod->isValidProblem(mpProblem)) return false;
113 
114  //we need to resize an initialize the result matrices before initializing the output
115  if (!updateMatrices()) return false;
116 
117  bool success = true;
118 
119  //initialize reporting
120  if (!CCopasiTask::initialize(of, pOutputHandler, pOstream)) success = false;
121 
122  if (!pProblem->getModel()->compileIfNecessary(mpCallBack)) success = false;
123 
124  CSteadyStateTask *pSubTask = pProblem->getSubTask();
125 
126  if (pSubTask)
127  success = pSubTask->initialize(CCopasiTask::NO_OUTPUT, NULL, mReport.getStream());
128 
129  //success = pSubTask->initialize(of, mReport.getStream());
130 
131  return success;
132 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
virtual bool updateMatrices()
Definition: CMCATask.cpp:84
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
CReport mReport
Definition: CCopasiTask.h:244
virtual bool isValidProblem(const CCopasiProblem *pProblem)
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
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 CMCATask::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 74 of file CMCATask.cpp.

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

75 {
76  configBuffer.getVariable("MCA", "bool", &mScheduled,
78 
79  ((CMCAProblem *) mpProblem)->load(configBuffer);
80 
81  ((CMCAMethod *) mpMethod)->load(configBuffer);
82 }
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 CMCATask::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 201 of file CMCATask.cpp.

References CSteadyStateMethod::found, CSteadyStateMethod::foundEquilibrium, CSteadyStateMethod::foundNegative, CCopasiProblem::getModel(), CMCAMethod::getScaledConcentrationCCAnn(), CMCAMethod::getScaledElasticitiesAnn(), CMCAMethod::getScaledFluxCCAnn(), CMCAMethod::getSteadyStateStatus(), CMCAProblem::getSubTask(), CMCAMethod::getUnscaledConcentrationCCAnn(), CMCAMethod::getUnscaledElasticitiesAnn(), CMCAMethod::getUnscaledFluxCCAnn(), CMCAProblem::isSteadyStateRequested(), CCopasiTask::mpMethod, CCopasiTask::mpProblem, CSteadyStateMethod::notFound, and CMCAMethod::setModel().

Referenced by CMCAProblem::printResult().

202 {
203  assert(mpProblem && mpMethod);
204 
205  CMCAProblem* pProblem =
206  dynamic_cast<CMCAProblem *>(mpProblem);
207  assert(pProblem);
208 
209  CMCAMethod* pMethod = dynamic_cast<CMCAMethod *>(mpMethod);
210  assert(pMethod);
211  pMethod->setModel(mpProblem->getModel());
212 
213  std::ostream & os = *ostream;
214 
215  bool showCCs = false; //show CCs?
216  bool showSS = false; //show Steady State result?
217 
218  if (pProblem->isSteadyStateRequested())
219  {
221  {
222  os << "A steady state was found. All coefficients are shown." << std::endl;
223  showCCs = true;
224  showSS = true;
225  }
226 
228  {
229  os << "Found equilibrium steady state. Only elasticities available." << std::endl;
230  showSS = true;
231  }
232 
234  {
235  os << "Invalid steady state found (negative concentrations)." << std::endl;
236  showSS = true;
237  }
238 
240  {
241  os << "No steady state found. Only elasticities available." << std::endl;
242  }
243  }
244  else
245  {
246  os << "Since no steady state calculation was requested only elasticities are shown." << std::endl;
247  }
248 
249  os << std::endl;
250  os << *pMethod->getUnscaledElasticitiesAnn() << std::endl;
251  os << *pMethod->getScaledElasticitiesAnn() << std::endl;
252 
253  if (showCCs)
254  {
255  os << *pMethod->getUnscaledConcentrationCCAnn() << std::endl;
256  os << *pMethod->getScaledConcentrationCCAnn() << std::endl;
257 
258  os << *pMethod->getUnscaledFluxCCAnn() << std::endl;
259  os << *pMethod->getScaledFluxCCAnn() << std::endl;
260  }
261 
262  if (showSS)
263  {
264  if (!pProblem->getSubTask())
265  {
266  os << "Problem with steady state calculation. Please report as bug!" << std::endl;
267  return;
268  }
269 
270  os << "Results of the steady state subtask (the state for which the MCA was performed):" << std::endl;
271  os << *pProblem->getSubTask();
272  }
273 }
const CArrayAnnotation * getUnscaledFluxCCAnn() const
Definition: CMCAMethod.h:94
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
const CArrayAnnotation * getScaledConcentrationCCAnn() const
Definition: CMCAMethod.h:92
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
const CSteadyStateMethod::ReturnCode & getSteadyStateStatus() const
Definition: CMCAMethod.h:147
bool isSteadyStateRequested() const
const CArrayAnnotation * getUnscaledConcentrationCCAnn() const
Definition: CMCAMethod.h:90
const CArrayAnnotation * getScaledElasticitiesAnn() const
Definition: CMCAMethod.h:88
const CArrayAnnotation * getScaledFluxCCAnn() const
Definition: CMCAMethod.h:96
CSteadyStateTask * getSubTask() const
void setModel(CModel *model)
Definition: CMCAMethod.cpp:663
const CArrayAnnotation * getUnscaledElasticitiesAnn() const
Definition: CMCAMethod.h:86
CModel * getModel() const
bool CMCATask::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 134 of file CMCATask.cpp.

References COutputInterface::AFTER, CModel::applyInitialValues(), COutputInterface::BEFORE, COutputInterface::DURING, CCopasiProblem::getModel(), CCopasiTask::mpCallBack, CCopasiTask::mpMethod, CCopasiTask::mpProblem, CCopasiTask::output(), CMCAMethod::process(), CSteadyStateTask::process(), CCopasiTask::setCallBack(), and CMCAMethod::setSteadyStateTask().

135 {
136  bool success = true;
137 
138  assert(mpMethod);
139 
140  CMCAMethod* pMethod = dynamic_cast<CMCAMethod *>(mpMethod);
141  assert(pMethod);
142  // pMethod->setModel(mpProblem->getModel());
143 
144  CSteadyStateTask *pSubTask =
145  dynamic_cast<CMCAProblem *>(mpProblem)->getSubTask();
146 
147  if (pSubTask)
148  {
149  pSubTask->setCallBack(mpCallBack);
150  success &= pSubTask->process(useInitialValues);
151 
152  if (!success && useInitialValues)
153  {
155  }
156 
157  pMethod->setSteadyStateTask(pSubTask);
158  }
159  else
160  {
161  pMethod->setSteadyStateTask(NULL);
162 
163  if (useInitialValues)
164  {
166  }
167  }
168 
170 
171  pMethod->process();
172 
175 
176  return success;
177 }
virtual bool setCallBack(CProcessReport *pCallBack)
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual bool process(const bool &useInitialValues)
void setSteadyStateTask(CSteadyStateTask *pSteadyStateTask)
Definition: CMCAMethod.cpp:773
CProcessReport * mpCallBack
Definition: CCopasiTask.h:249
virtual void output(const COutputInterface::Activity &activity)
void applyInitialValues()
Definition: CModel.cpp:1236
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool process()
Definition: CMCAMethod.cpp:757
CModel * getModel() const
bool CMCATask::restore ( )
virtual

Perform neccessary cleaup procedures

Reimplemented from CCopasiTask.

Definition at line 179 of file CMCATask.cpp.

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

180 {
181  bool success = CCopasiTask::restore();
182 
183  CSteadyStateTask *pSubTask =
184  dynamic_cast<CMCAProblem *>(mpProblem)->getSubTask();
185 
186  if (pSubTask)
187  success &= pSubTask->restore();
188 
189  return success;
190 }
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
virtual bool restore()
virtual bool restore()
bool CMCATask::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 84 of file CMCATask.cpp.

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

Referenced by initialize().

85 {
86  assert(mpProblem != NULL && mpMethod != NULL);
87 
88  assert(dynamic_cast<CMCAProblem *>(mpProblem) != NULL);
89 
90  if (!mpMethod->isValidProblem(mpProblem)) return false;
91 
92  CMCAMethod * pMethod = dynamic_cast<CMCAMethod*>(mpMethod);
93 
94  if (!pMethod) return false;
95 
96  pMethod->setModel(mpProblem->getModel());
97  pMethod->resizeAllMatrices();
98 
99  return true;
100 }
CCopasiMethod * mpMethod
Definition: CCopasiTask.h:239
virtual void resizeAllMatrices()
Definition: CMCAMethod.cpp:160
virtual bool isValidProblem(const CCopasiProblem *pProblem)
CCopasiProblem * mpProblem
Definition: CCopasiTask.h:234
void setModel(CModel *model)
Definition: CMCAMethod.cpp:663
CModel * getModel() const

Friends And Related Function Documentation

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

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