COPASI API  4.16.103
CSensProblem.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2005 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef COPASI_CSensProblem
16 #define COPASI_CSensProblem
17 
18 #include <string>
19 
23 
24 /**
25  * This class describes either one specific COPASI object (represented
26  * by a registered object CN internally) or a list of objects (see CObjectLists
27  * class).
28  */
29 class CSensItem
30 {
31 public:
32 
33  CSensItem();
34 
35  bool isSingleObject() const;
36 
37  void setSingleObjectCN(const CCopasiObjectName & cn);
38  const CCopasiObjectName & getSingleObjectCN() const;
39  std::string getSingleObjectDisplayName(const CCopasiDataModel* pDataModel) const;
40 
42  const CObjectLists::ListType & getListType() const;
43  std::string getListTypeDisplayName() const;
44 
45  std::vector<CCopasiObject*> getVariablesPointerList(CCopasiDataModel* pDataModel);
46 
47  //size_t dimensionality() const;
48 
49  bool operator==(const CSensItem & rhs) const;
50  bool operator!=(const CSensItem & rhs) const;
51 
52  std::string print(const CCopasiDataModel* pDataModel) const;
53 
54 private:
57 };
58 
59 //****************************************************************
60 
61 /**
62  * CSensProblem class.
63  */
65 {
66 public:
67  /**
68  * this enumeration
69  */
70 
72  {
79  //LyapunovExp
80  };
81 
82  static const std::string SubTaskName[];
83 
84  static const char * XMLSubTask[];
85 
86  static std::vector<CObjectLists::ListType> getPossibleTargetFunctions(CSensProblem::SubTaskType);
87  static std::vector<CObjectLists::ListType> getPossibleVariables(CSensProblem::SubTaskType);
88 
89  // Operations
90 
91  /**
92  * Default constructor.
93  * @param const CCopasiContainer * pParent (default: NULL)
94  */
95  CSensProblem(const CCopasiContainer * pParent = NULL);
96 
97  /**
98  * Copy constructor.
99  * @param "const CSensProblem &" src
100  * @paramconst CCopasiContainer * pParent (default: NULL)
101  */
102  CSensProblem(const CSensProblem & src,
103  const CCopasiContainer * pParent = NULL);
104 
105  /**
106  * Destructor.
107  */
108  virtual ~CSensProblem();
109 
110  /**
111  * set the problem's SubTaskType:
112  */
113  void setSubTaskType(const CSensProblem::SubTaskType & type);
114 
115  /**
116  * get the problem's SubTaskType:
117  */
119 
121  void changeTargetFunctions(const CSensItem item);
122 
123  size_t getNumberOfVariables() const;
124  CSensItem getVariables(size_t index) const;
125 
126  void addVariables(const CSensItem & item);
127 
128  bool changeVariables(size_t index, const CSensItem & item);
129 
130  bool removeVariables(size_t index);
131 
132  //remove all variables:
133  bool removeVariables();
134 
136  const CCopasiArray & getResult() const;
138  const CArrayAnnotation * getResultAnnotated() const;
139 
141  const CCopasiArray & getScaledResult() const;
144 
146  const CCopasiArray & getCollapsedResult() const;
149 
150  bool collapsRequested() const;
151 
152  /**
153  * This is the output method for any result of a problem. The default implementation
154  * provided with CCopasiProblem. Does only print "Not implemented." To overide this
155  * default behaviour one needs to reimplement the virtual printResult function.
156  * @param std::ostream * ostream
157  */
158  virtual void printResult(std::ostream * ostream) const;
159 
160  /**
161  * Output stream operator. Prints description of the problem
162  * @param ostream & os
163  * @param const Problem & A
164  * @return ostream & os
165  */
166  friend std::ostream &operator<<(std::ostream &os, const CSensProblem & o);
167 
168  /**
169  * This is the output method for any object. It calls the insert operator<<
170  * @param std::ostream * ostream
171  */
172  virtual void print(std::ostream * ostream) const;
173 
174 private:
175 
176  void initObjects();
177 
178  /**
179  * create the copasi parameters corresponding to the members of a CSensItem
180  */
182 
183  static void copySensItemToParameterGroup(const CSensItem * si, CCopasiParameterGroup *pg);
184 
185  static void copyParameterGroupToSensItem(const CCopasiParameterGroup *pg, CSensItem * si);
186 
187  /**
188  * this sets up a problem for debugging purposes
189  */
190  void initDebugProblem();
191 
193 
195 
196  //std::vector<CSensItem> mVariables;
197 
198  /**
199  * This holds the variables items
200  */
202 
203  /**
204  * This holds the result
205  */
207 
209 
210  /**
211  * This holds the scaled result
212  */
214 
216 
217  /**
218  * This holds the collapsed result
219  */
221 
223 };
224 
225 #endif // COPASI_CSensProblem
CCopasiArray mScaledResult
Definition: CSensProblem.h:213
std::string getListTypeDisplayName() const
bool collapsRequested() const
size_t getNumberOfVariables() const
friend std::ostream & operator<<(std::ostream &os, const CSensProblem &o)
CCopasiParameterGroup * mpTargetFunctions
Definition: CSensProblem.h:194
virtual void print(std::ostream *ostream) const
CSensItem getVariables(size_t index) const
static const std::string SubTaskName[]
Definition: CSensProblem.h:82
static const char * XMLSubTask[]
Definition: CSensProblem.h:84
void initDebugProblem()
CSensProblem::SubTaskType getSubTaskType() const
CArrayAnnotation * getCollapsedResultAnnotated()
CArrayAnnotation * mpCollapsedResultAnnotation
Definition: CSensProblem.h:222
void changeTargetFunctions(const CSensItem item)
static std::vector< CObjectLists::ListType > getPossibleVariables(CSensProblem::SubTaskType)
CCopasiArray mCollapsedResult
Definition: CSensProblem.h:220
std::vector< CCopasiObject * > getVariablesPointerList(CCopasiDataModel *pDataModel)
CArrayAnnotation * getScaledResultAnnotated()
void setSingleObjectCN(const CCopasiObjectName &cn)
static void copyParameterGroupToSensItem(const CCopasiParameterGroup *pg, CSensItem *si)
CCopasiArray & getResult()
void initObjects()
static void createParametersInGroup(CCopasiParameterGroup *pg)
CCopasiParameterGroup * mpVariablesGroup
Definition: CSensProblem.h:201
CSensItem getTargetFunctions() const
bool operator!=(const CSensItem &rhs) const
bool isSingleObject() const
const CObjectLists::ListType & getListType() const
static std::vector< CObjectLists::ListType > getPossibleTargetFunctions(CSensProblem::SubTaskType)
bool operator==(const CSensItem &rhs) const
bool removeVariables()
CArrayAnnotation * getResultAnnotated()
CCopasiArray & getCollapsedResult()
CObjectLists::ListType mListType
Definition: CSensProblem.h:56
CCopasiArray & getScaledResult()
CArrayAnnotation * mpResultAnnotation
Definition: CSensProblem.h:208
virtual void printResult(std::ostream *ostream) const
bool changeVariables(size_t index, const CSensItem &item)
CCopasiObjectName mSingleObjectCN
Definition: CSensProblem.h:55
Header file of class CArrayAnnotation.
virtual ~CSensProblem()
CSensProblem(const CCopasiContainer *pParent=NULL)
void addVariables(const CSensItem &item)
void setListType(CObjectLists::ListType lt)
std::string getSingleObjectDisplayName(const CCopasiDataModel *pDataModel) const
CCopasiArray mResult
Definition: CSensProblem.h:206
std::string print(const CCopasiDataModel *pDataModel) const
void setSubTaskType(const CSensProblem::SubTaskType &type)
static void copySensItemToParameterGroup(const CSensItem *si, CCopasiParameterGroup *pg)
CArrayAnnotation * mpScaledResultAnnotation
Definition: CSensProblem.h:215
const CCopasiObjectName & getSingleObjectCN() const
CSensProblem::SubTaskType * mpSubTaskType
Definition: CSensProblem.h:192