COPASI API  4.16.103
CSteadyStateTask.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/steadystate/CSteadyStateTask.h,v $
3 // $Revision: 1.38 $
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  * CSteadyStateTask class.
25  *
26  * This class implements a steady state 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 Stefan Hoops 2002
31  */
32 
33 #ifndef COPASI_CSteadyStateTask
34 #define COPASI_CSteadyStateTask
35 
36 #include <iostream>
37 
38 #include "utilities/CCopasiTask.h"
39 #include "utilities/CMatrix.h"
41 #include "utilities/CReadConfig.h"
43 #include "steadystate/CEigen.h"
44 
46 class CState;
48 
50 {
51  //Attributes
52 private:
53  /**
54  * A pointer to the found steady state.
55  */
57 
58  /**
59  * The jacobian of the steady state.
60  */
62 
63  /**
64  * The jacobian of the steady state.
65  */
67 
70 
71  /**
72  * Whether the model is actually reducible and calculating
73  * stability of the reduced steady states makes sense
74  */
76 
77  /**
78  * The Eigenvalues of the Jacobian of the system
79  */
81 
82  /**
83  * The Eigenvalues of the Jacobian of the reduced system
84  */
86 
87  /**
88  * The Eigenvalues matrix of the Jacobian of the system
89  */
91 
92  /**
93  * The Eigenvalues matrix of the Jacobian of the reduced system
94  */
96 
99 
100  /**
101  * The result of the steady state analysis.
102  */
104 
105  //Operations
106 public:
107 
108  /**
109  * Default constructor
110  * @param const CCopasiContainer * pParent (default: NULL)
111  */
112  CSteadyStateTask(const CCopasiContainer * pParent = NULL);
113 
114  /**
115  * Copy constructor
116  * @param const CSteadyStateTask & src
117  * @param const CCopasiContainer * pParent (default: NULL)
118  */
120  const CCopasiContainer * pParent = NULL);
121 
122  /**
123  * Destructor
124  */
125  virtual ~CSteadyStateTask();
126 
127  /**
128  * Create a method of the specified type to solve the task.
129  * It is the duty of the caller to release the CCopasiMethod.
130  * @param const CCopasiMethod::SubType & type
131  * @return CCopasiMethod *
132  */
133  virtual CCopasiMethod * createMethod(const int & type) const;
134 
135  /**
136  * Resizes result matrices and updates array annotations for a specific task.
137  * This is used when we need to know about the data structures of a task result
138  * without actually performing the task, e.g. when selecting objects for output.
139  * For now we assume that this functionality is also performed when
140  * initialize() is called.
141  */
142  virtual bool updateMatrices();
143 
144  /**
145  * Initialize the task. If an ostream is given this ostream is used
146  * instead of the target specified in the report. This allows nested
147  * tasks to share the same output device.
148  * @param const OutputFlag & of
149  * @param COutputHandler * pOutputHandler
150  * @param std::ostream * pOstream (default: NULL)
151  * @return bool success
152  */
153  virtual bool initialize(const OutputFlag & of,
154  COutputHandler * pOutputHandler,
155  std::ostream * pOstream);
156 
157  /**
158  * Process the task with or without initializing to the initial state.
159  * @param const bool & useInitialValues
160  * @return bool success
161  */
162  virtual bool process(const bool & useInitialValues);
163 
164  /**
165  * Perform necessary cleanup procedures
166  */
167  virtual bool restore();
168 
169  /**
170  * This is the output method for any object. The default implementation
171  * provided with CCopasiObject uses the ostream operator<< of the object
172  * to print the object.To override this default behavior one needs to
173  * reimplement the virtual print function.
174  * @param std::ostream * ostream
175  */
176  virtual void print(std::ostream * ostream) const;
177 
178  /**
179  * Loads parameters for this solver with data coming from a
180  * CReadConfig object. (CReadConfig object reads an input stream)
181  * @param configbuffer reference to a CReadConfig object.
182  */
183  void load(CReadConfig & configBuffer);
184 
185  /**
186  * Set initial state by taking the current one.
187  */
188  void setInitialState();
189 
190  /**
191  * Retrieves a pointer to steady state.
192  * @return CState * pSteadyState
193  */
194  //CState * getState();
195  const CState * getState() const;
196 
197  /**
198  * Retrieves a the jacobian of the steady state.
199  * @return const CMatrix< C_FLOAT64 > jacobian
200  */
201  const CMatrix< C_FLOAT64 > & getJacobian() const;
202  const CArrayAnnotation * getJacobianAnnotated() const;
203 
204  /**
205  * Retrieves a the jacobian of the steady state.
206  * @return const CMatrix< C_FLOAT64 > jacobian
207  */
209  const CArrayAnnotation * getJacobianXAnnotated() const;
210 
211  /**
212  * Retrieves a the eigenvalues of the steady state.
213  * @return const CEigen & eigenValues
214  */
215  const CEigen & getEigenValues() const;
216 
217  /**
218  * Retrieves a the eigenvalues of the steady state.
219  * @return const CEigen & eigenValues
220  */
221  const CEigen & getEigenValuesReduced() const;
222 
223  /**
224  * Converts the eigenvalues vector to matrix
225  * @param CEigen &eigenvalues
226  * @return CMatrix<C_FLOAT64> &matrix
227  */
228 // CMatrix<C_FLOAT64> & createEigenvalueMatrix(CEigen &eigenvalues);
229 
231 
232  // Friend functions
233  friend std::ostream &operator<<(std::ostream &os,
234  const CSteadyStateTask &A);
235 
236 private:
237  /**
238  * cleanup()
239  */
240  void cleanup();
241 
242  void initObjects();
243 };
244 
245 #endif // COPASI_CSteadyStateTask
CSteadyStateMethod::ReturnCode mResult
const CSteadyStateMethod::ReturnCode & getResult() const
const CArrayAnnotation * getJacobianAnnotated() const
virtual bool process(const bool &useInitialValues)
Definition: CEigen.h:36
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CState.h:305
CMatrix< C_FLOAT64 > mJacobianX
const CState * getState() const
CArrayAnnotation * mpJacobianAnn
const CArrayAnnotation * getJacobianXAnnotated() const
const CEigen & getEigenValues() const
CArrayAnnotation * mpJacobianXAnn
virtual ~CSteadyStateTask()
virtual bool updateMatrices()
CSteadyStateTask(const CCopasiContainer *pParent=NULL)
const CMatrix< C_FLOAT64 > & getJacobianReduced() const
Header file of class CArrayAnnotation.
const CEigen & getEigenValuesReduced() const
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
CMatrix< C_FLOAT64 > mEigenvaluesXMatrix
void load(CReadConfig &configBuffer)
virtual bool restore()
const CMatrix< C_FLOAT64 > & getJacobian() const
CMatrix< C_FLOAT64 > mJacobian
CArrayAnnotation * mpEigenvaluesJacobianXAnn
virtual void print(std::ostream *ostream) const
CMatrix< C_FLOAT64 > mEigenvaluesMatrix
CArrayAnnotation * mpEigenvaluesJacobianAnn
friend std::ostream & operator<<(std::ostream &os, const CSteadyStateTask &A)