COPASI API  4.16.103
CLNATask.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/lna/CLNATask.h,v $
3 // $Revision: 1.1 $
4 // $Name: $
5 // $Author: jpahle $
6 // $Date: 2011/05/24 17:33:45 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 /**
15  * CLNATask class.
16  *
17  * This class implements a linear noise approximation analysis task which is comprised
18  * of a problem and a method.
19  *
20  * Created for Copasi by Juergen Pahle 2010
21  */
22 
23 #ifndef COPASI_CLNATask_H__
24 #define COPASI_CLNATask_H__
25 
26 #include <iostream>
27 
28 #include "utilities/CCopasiTask.h"
29 #include "utilities/CMatrix.h"
30 #include "utilities/CReadConfig.h"
33 #include "steadystate/CEigen.h"
34 
35 class CLNAProblem;
36 class CState;
37 
38 class CLNATask : public CCopasiTask
39 {
40  //Attributes
41 private:
42 
43  //Operations
44 public:
45 
46  /**
47  * Default constructor
48  * @param const CCopasiContainer * pParent (default: NULL)
49  */
50  CLNATask(const CCopasiContainer * pParent = NULL);
51 
52  /**
53  * Copy constructor
54  * @param const CLNATask & src
55  * @param const CCopasiContainer * pParent (default: NULL)
56  */
57  CLNATask(const CLNATask & src,
58  const CCopasiContainer * pParent = NULL);
59 
60  /**
61  * Destructor
62  */
63  virtual ~CLNATask();
64 
65  /**
66  * Create a method of the specified type to solve the task.
67  * It is the duty of the caller to release the CCopasiMethod.
68  * @param const CCopasiMethod::SubType & type
69  * @return CCopasiMethod *
70  */
71  virtual CCopasiMethod * createMethod(const int & type) const;
72 
73  /**
74  * Resizes result matrices and updates array annotations for a specific task.
75  * This is used when we need to know about the data structures of a task result
76  * without actually performing the task, e.g. when selecting objects for output.
77  * For now we assume that this functionality is also performed when
78  * initialize() is called.
79  */
80  virtual bool updateMatrices();
81 
82  /**
83  * Initialize the task. If an ostream is given this ostream is used
84  * instead of the target specified in the report. This allows nested
85  * tasks to share the same output device.
86  * @param const OutputFlag & of
87  * @param COutputHandler * pOutputHandler
88  * @param std::ostream * pOstream (default: NULL)
89  * @return bool success
90  */
91  virtual bool initialize(const OutputFlag & of,
92  COutputHandler * pOutputHandler,
93  std::ostream * pOstream);
94 
95  /**
96  * Process the task with or without initializing to the initial state.
97  * @param const bool & useInitialValues
98  * @return bool success
99  */
100  virtual bool process(const bool & useInitialValues);
101 
102  /**
103  * Perform neccessary cleanup procedures
104  */
105  virtual bool restore();
106 
107  /**
108  * Loads parameters for this solver with data coming from a
109  * CReadConfig object. (CReadConfig object reads an input stream)
110  * @param configbuffer reference to a CReadConfig object.
111  */
112  void load(CReadConfig & configBuffer);
113 
114  // Friend functions
115  friend std::ostream &operator<<(std::ostream &os,
116  const CLNATask &A);
117 
118  /**
119  * This functionality is expected from the problem but has to be implemented
120  * here for the moment. This is called from the corresponding method of the problem
121  */
122  void printResult(std::ostream * ostream) const;
123 
124 private:
125  /**
126  * cleanup()
127  */
128  void cleanup();
129 };
130 
131 #endif // COPASI_CLNATask_H__
virtual ~CLNATask()
Definition: CLNATask.cpp:50
virtual bool process(const bool &useInitialValues)
Definition: CLNATask.cpp:124
Definition: CState.h:305
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CLNATask.cpp:54
friend std::ostream & operator<<(std::ostream &os, const CLNATask &A)
virtual bool updateMatrices()
Definition: CLNATask.cpp:74
void printResult(std::ostream *ostream) const
Definition: CLNATask.cpp:215
virtual bool restore()
Definition: CLNATask.cpp:193
CLNATask(const CCopasiContainer *pParent=NULL)
Definition: CLNATask.cpp:30
void load(CReadConfig &configBuffer)
Definition: CLNATask.cpp:64
void cleanup()
Definition: CLNATask.cpp:61
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
Definition: CLNATask.cpp:94