COPASI API  4.16.103
CMCATask.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/steadystate/CMCATask.h,v $
3 // $Revision: 1.12 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:33:41 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 - 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  * CMCATask class.
25  *
26  * This class implements a metabolic control analysis task which is comprised of a
27  * of a problem and a method. Additionally calls to the reporting
28  * methods are done when initialized.
29  *
30  * Created for COPASI by Ralph Gauges 2004
31  */
32 
33 #ifndef COPASI_CMCATask_H__
34 #define COPASI_CMCATask_H__
35 
36 #include <iostream>
37 
38 #include "utilities/CCopasiTask.h"
39 #include "utilities/CMatrix.h"
40 #include "utilities/CReadConfig.h"
42 
43 class CMCAProblem;
44 class CState;
45 
46 class CMCATask : public CCopasiTask
47 {
48  //Attributes
49 private:
50  /**
51  * A pointer to the found elasticities
52  */
53 
54  /**
55  * A pointer to the found flux control coefficients.
56  */
57 
58  /**
59  * A pointer to the found concentration control coefficients.
60  */
61 
62  //Operations
63 public:
64 
65  /**
66  * Default constructor
67  * @param const CCopasiContainer * pParent (default: NULL)
68  */
69  CMCATask(const CCopasiContainer * pParent = NULL);
70 
71  /**
72  * Copy constructor
73  * @param const CMCATask & src
74  * @param const CCopasiContainer * pParent (default: NULL)
75  */
76  CMCATask(const CMCATask & src,
77  const CCopasiContainer * pParent = NULL);
78 
79  /**
80  * Destructor
81  */
82  virtual ~CMCATask();
83 
84  /**
85  * Create a method of the specified type to solve the task.
86  * It is the duty of the caller to release the CCopasiMethod.
87  * @param const CCopasiMethod::SubType & type
88  * @return CCopasiMethod *
89  */
90  virtual CCopasiMethod * createMethod(const int & type) const;
91 
92  /**
93  * Resizes result matrices and updates array annotations for a specific task.
94  * This is used when we need to know about the data structures of a task result
95  * without actually performing the task, e.g. when selecting objects for output.
96  * For now we assume that this functionality is also performed when
97  * initialize() is called.
98  */
99  virtual bool updateMatrices();
100 
101  /**
102  * Initialize the task. If an ostream is given this ostream is used
103  * instead of the target specified in the report. This allows nested
104  * tasks to share the same output device.
105  * @param const OutputFlag & of
106  * @param COutputHandler * pOutputHandler
107  * @param std::ostream * pOstream (default: NULL)
108  * @return bool success
109  */
110  virtual bool initialize(const OutputFlag & of,
111  COutputHandler * pOutputHandler,
112  std::ostream * pOstream);
113 
114  /**
115  * Process the task with or without initializing to the initial state.
116  * @param const bool & useInitialValues
117  * @return bool success
118  */
119  virtual bool process(const bool & useInitialValues);
120 
121  /**
122  * Perform neccessary cleaup procedures
123  */
124  virtual bool restore();
125 
126  /**
127  * Loads parameters for this solver with data coming from a
128  * CReadConfig object. (CReadConfig object reads an input stream)
129  * @param configbuffer reference to a CReadConfig object.
130  */
131  void load(CReadConfig & configBuffer);
132 
133  // Friend functions
134  friend std::ostream &operator<<(std::ostream &os,
135  const CMCATask &A);
136 
137  /**
138  * This functionality is expected from the problem but has to be implemented
139  * here for the moment. This is called from the corresponding method of the problem
140  */
141  void printResult(std::ostream * ostream) const;
142 
143 private:
144  /**
145  * cleanup()
146  */
147  void cleanup();
148 };
149 
150 #endif // COPASI_CMCATask_H__
void load(CReadConfig &configBuffer)
Definition: CMCATask.cpp:74
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CMCATask.cpp:64
virtual bool updateMatrices()
Definition: CMCATask.cpp:84
Definition: CState.h:305
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
Definition: CMCATask.cpp:102
void printResult(std::ostream *ostream) const
Definition: CMCATask.cpp:201
void cleanup()
Definition: CMCATask.cpp:71
friend std::ostream & operator<<(std::ostream &os, const CMCATask &A)
virtual bool restore()
Definition: CMCATask.cpp:179
virtual ~CMCATask()
Definition: CMCATask.cpp:60
virtual bool process(const bool &useInitialValues)
Definition: CMCATask.cpp:134
CMCATask(const CCopasiContainer *pParent=NULL)
Definition: CMCATask.cpp:40