COPASI API  4.16.103
CSensTask.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/sensitivities/CSensTask.h,v $
3 // $Revision: 1.10 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/03/07 19:33:42 $
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  * CSensTask class.
25  *
26  */
27 
28 #ifndef COPASI_CSensTask
29 #define COPASI_CSensTask
30 
31 #include <iostream>
32 
33 #include "utilities/CCopasiTask.h"
34 
35 class CSensTask : public CCopasiTask
36 {
37 public:
38 
39  /**
40  * Default constructor
41  * @param const CCopasiContainer * pParent (default: NULL)
42  */
43  CSensTask(const CCopasiContainer * pParent = NULL);
44 
45  /**
46  * Copy constructor
47  * @param const CSensTask & src
48  * @param const CCopasiContainer * pParent (default: NULL)
49  */
50  CSensTask(const CSensTask & src,
51  const CCopasiContainer * pParent = NULL);
52 
53  /**
54  * Destructor
55  */
56  virtual ~CSensTask();
57 
58  /**
59  * Create a method of the specified type to solve the task.
60  * It is the duty of the caller to release the CCopasiMethod.
61  * @param const CCopasiMethod::SubType & type
62  * @return CCopasiMethod *
63  */
64  virtual CCopasiMethod * createMethod(const int & type) const;
65 
66  /**
67  * Resizes result matrices and updates array annotations.
68  * This is used when we need to know about the data structures of a task result
69  * without actually performing the task, e.g. when selecting objects for output.
70  * For now we assume that this functionality is also performed when
71  * initialize() is called.
72  */
73  virtual bool updateMatrices();
74 
75  /**
76  * Initialize the task. If an ostream is given this ostream is used
77  * instead of the target specified in the report. This allows nested
78  * tasks to share the same output device.
79  * @param const OutputFlag & of
80  * @param COutputHandler * pOutputHandler
81  * @param std::ostream * pOstream (default: NULL)
82  * @return bool success
83  */
84  virtual bool initialize(const OutputFlag & of,
85  COutputHandler * pOutputHandler,
86  std::ostream * pOstream);
87 
88  /**
89  * Process the task with or without initializing to the initial state.
90  * @param const bool & useInitialValues
91  * @return bool success
92  */
93  virtual bool process(const bool & useInitialValues);
94 
95  /**
96  * Perform necessary cleanup procedures
97  */
98  virtual bool restore();
99 
100  /**
101  * This is the output method for any object. The default implementation
102  * provided with CCopasiObject uses the ostream operator<< of the object
103  * to print the object.To overide this default behaviour one needs to
104  * reimplement the virtual print function.
105  * @param std::ostream * ostream
106  */
107  virtual void print(std::ostream * ostream) const;
108 
109  // Friend functions
110  friend std::ostream &operator<<(std::ostream &os,
111  const CSensTask &A);
112 
113 private:
114  /**
115  * cleanup()
116  */
117  void cleanup();
118 };
119 
120 #endif // COPASI_CSensTask
virtual CCopasiMethod * createMethod(const int &type) const
Definition: CSensTask.cpp:66
virtual bool restore()
Definition: CSensTask.cpp:143
virtual ~CSensTask()
Definition: CSensTask.cpp:62
friend std::ostream & operator<<(std::ostream &os, const CSensTask &A)
Definition: CSensTask.cpp:156
virtual bool process(const bool &useInitialValues)
Definition: CSensTask.cpp:116
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
Definition: CSensTask.cpp:101
CSensTask(const CCopasiContainer *pParent=NULL)
Definition: CSensTask.cpp:41
virtual bool updateMatrices()
Definition: CSensTask.cpp:79
virtual void print(std::ostream *ostream) const
Definition: CSensTask.cpp:77
void cleanup()
Definition: CSensTask.cpp:73