COPASI API  4.16.103
CLyapMethod.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/lyap/CLyapMethod.h,v $
3 // $Revision: 1.3 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2009/04/21 16:16:11 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  * CLyapMethod class.
20  */
21 
22 #ifndef COPASI_CLyapMethod
23 #define COPASI_CLyapMethod
24 
25 #include <string>
26 
28 #include "utilities/CVector.h"
29 
30 class CLyapProblem;
31 class CState;
32 
33 class CLyapValidSubTypes : public std::vector< CCopasiMethod::SubType >
34 {
35 public:
36  /**
37  * Default constructor.
38  */
40 
41  /**
42  * Destructor.
43  */
45 };
46 
47 class CLyapMethod : public CCopasiMethod
48 {
49 public:
50  /**
51  * A list of valid trajectory method types;
52  */
54 
55  /**
56  * Checks whether the given sub type is a valid method
57  * @param const CCopasiMethod::SubType & subType
58  * @return bool isValidSubType
59  */
60  static bool isValidSubType(const CCopasiMethod::SubType & subType);
61 
62 protected:
63  /**
64  * A pointer to the current state. This is set from outside
65  * with the setState() method and never changed anywhere else.
66  * It�s used to report the results
67  * to the calling LyapTask
68  */
69  //CState * mpCurrentState;
70 
71  /**
72  * A pointer to the trajectory problem.
73  */
75 
76  // Operations
77 private:
78  /**
79  * Default constructor.
80  */
81  CLyapMethod();
82 
83 protected:
84  /**
85  * Default constructor.
86  * @param const CCopasiMethod::SubType & subType
87  * @param const CCopasiContainer * pParent (default: NULL)
88  */
89  CLyapMethod(const CCopasiMethod::SubType & subType,
90  const CCopasiContainer * pParent = NULL);
91 
92 public:
93 
94  /**
95  * Create a trajectory method for a special problem.
96  * Note: the returned object has to be released after use with delete
97  * a problem is also passed so that the method has a chance to choose an
98  * appropriate simulation method.
99  */
102 
103  /**
104  * Copy constructor.
105  * @param "const CLyapMethod &" src
106  * @param const CCopasiContainer * pParent (default: NULL)
107  */
108  CLyapMethod(const CLyapMethod & src,
109  const CCopasiContainer * pParent = NULL);
110 
111  /**
112  * Destructor.
113  */
114  ~CLyapMethod();
115 
116  /**
117  * Set a pointer to the current state.
118  * This method is used by CLyapTask::process()
119  * The results of the simulation are passed via this CState variable
120  * @param "CState *" currentState
121  */
122  //void setCurrentState(CState * currentState);
123 
124  /**
125  * Set a pointer to the problem.
126  * This method is used by CLyap
127  * @param "CLyapProblem *" problem
128  */
129  void setProblem(CLyapProblem * problem);
130 
131  /**
132  * This instructs the method to calculate a time step of deltaT
133  * starting with the current state, i.e., the result of the previous
134  * step.
135  * The new state (after deltaT) is expected in the current state.
136  * The return value is the actual timestep taken.
137  * @param "const double &" deltaT
138  */
139  virtual double step(const double & deltaT);
140 
141  virtual bool calculate() = 0;
142 
143  /**
144  * This instructs the method to prepare for integration
145  * starting with the initialState given.
146  * @param "const CState *" initialState
147  */
148  virtual void start(const CState * initialState);
149 
150  /**
151  * Check if the method is suitable for this problem
152  * @return bool suitability of the method
153  */
154  virtual bool isValidProblem(const CCopasiProblem * pProblem);
155 };
156 
157 #include "CLyapWolfMethod.h"
158 
159 #endif // COPASI_CLyapMethod
static const CLyapValidSubTypes ValidSubTypes
Definition: CLyapMethod.h:53
void setProblem(CLyapProblem *problem)
virtual double step(const double &deltaT)
Definition: CState.h:305
CLyapProblem * mpProblem
Definition: CLyapMethod.h:74
virtual bool isValidProblem(const CCopasiProblem *pProblem)
static CLyapMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::lyapWolf)
Definition: CLyapMethod.cpp:58
static bool isValidSubType(const CCopasiMethod::SubType &subType)
Definition: CLyapMethod.cpp:48
virtual bool calculate()=0
virtual void start(const CState *initialState)