COPASI API  4.16.103
CExperimentObjectMap.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_CExperimentObjectMap
16 #define COPASI_CExperimentObjectMap
17 
19 
21 #include "utilities/CVector.h"
22 
24 {
25 public:
26 
28  {
29  public:
30  /**
31  * Default constructor
32  * @param const std::string & name (default: Object Map)
33  * @param const CCopasiContainer * pParent (default: NULL)
34  */
35  CDataColumn(const std::string & name = "Object Map",
36  const CCopasiContainer * pParent = NULL);
37 
38  /**
39  * Copy constructor
40  * @param const CDataColumn & src
41  * @param const CCopasiContainer * pParent (default: NULL)
42  */
43  CDataColumn(const CDataColumn & src,
44  const CCopasiContainer * pParent = NULL);
45 
46  /**
47  * Specific constructor used for reading COPASI files
48  * @param const CCopasiParameterGroup & group
49  * @param const CCopasiContainer * pParent (default: NULL)
50  */
51  CDataColumn(const CCopasiParameterGroup & group,
52  const CCopasiContainer * pParent = NULL);
53 
54  /**
55  * Destructor
56  */
57  virtual ~CDataColumn();
58 
59  private:
60  /**
61  * Allocates all group parameters and assures that they are
62  * properly initialized.
63  */
64  void initializeParameter();
65 
66  public:
67  /**
68  * Assignment operator
69  * @param const CDataColumn & rhs
70  * @return CDataColumn & lhs
71  */
72  CDataColumn & operator = (const CDataColumn & rhs);
73 
74  /**
75  * This methods must be called to elevate subgroups to
76  * derived objects. The default implementation does nothing.
77  * @return bool success
78  */
79  virtual bool elevateChildren();
80 
81  /**
82  * Set the role of the column
83  * @param const CExperiment::Type & role
84  * @return bool success
85  */
86  bool setRole(const CExperiment::Type & role);
87 
88  /**
89  * Retrieve the role of the column
90  * @return const CExperiment::Type & role
91  */
92  const CExperiment::Type & getRole() const;
93 
94  /**
95  * Set the object CN of the object mapped to the column
96  * @param const std::string & objectCN
97  * @return bool success
98  */
99  bool setObjectCN(const std::string & objectCN);
100 
101  /**
102  * Retrieve the object CN of the object mapped to the column
103  * @return std::string objctCN
104  */
105  std::string getObjectCN() const;
106 
107  /**
108  * Set the scaling factor for the column
109  * @param const C_FLOAT64 & scale
110  * @return bool success
111  */
112  bool setScale(const C_FLOAT64 & scale);
113 
114  /**
115  * Retrieve the scaling factor of the column
116  * @return C_FLOAT64 scale
117  */
118  C_FLOAT64 getScale() const;
119 
120  /**
121  * Retrieve the default weight of the column
122  * @return C_FLOAT64 defaultScale
123  */
124  C_FLOAT64 getDefaultScale() const;
125 
126  /**
127  * Fix files written with Version 4.10.55, which wrote the square root of user defined weights for the
128  * parameter fitting task
129  */
130  void fixBuild55();
131 
132  // Attributes
133  private:
135 
137 
139  };
140 
141 public:
142  /**
143  * Default constructor
144  * @param const std::string & name (default: Object Map)
145  * @param const CCopasiContainer * pParent (default: NULL)
146  */
147  CExperimentObjectMap(const std::string & name = "Object Map",
148  const CCopasiContainer * pParent = NULL);
149 
150  /**
151  * Copy constructor
152  * @param const CExperimentObjectMap & src
153  * @param const CCopasiContainer * pParent (default: NULL)
154  */
156  const CCopasiContainer * pParent = NULL);
157 
158  /**
159  * Specific constructor used for reading copasi files
160  * @param const CCopasiParameterGroup & group
161  * @param const CCopasiContainer * pParent (default: NULL)
162  */
164  const CCopasiContainer * pParent = NULL);
165 
166  /**
167  * Destructor
168  */
169  virtual ~CExperimentObjectMap();
170 
171 private:
172  /**
173  * Allocates all group parameters and assures that they are
174  * properly initialized.
175  */
176  void initializeParameter();
177 
178 public:
179  /**
180  * This methods must be called to elevate subgroups to
181  * derived objects. The default implementation does nothing.
182  * @return bool success
183  */
184  virtual bool elevateChildren();
185 
186  /**
187  * Set the number of data columns
188  * @param const size_t & numCols
189  * @return bool success
190  */
191  bool setNumCols(const size_t & numCols);
192 
193  /**
194  * Retrieve the last non ignored column
195  * @return size_t lastNotIgnoredColumn
196  */
197  size_t getLastNotIgnoredColumn() const;
198 
199  /**
200  * Retrieve the name of a parameter or subgroup
201  * @param const size_t & index
202  * @return std::string name
203  */
204  virtual const std::string & getName(const size_t & index) const;
205 
206  /**
207  * Set the role of the indexed column
208  * @param const size_t & index
209  * @param const CExperiment::Type & role
210  * @return bool success
211  */
212  bool setRole(const size_t & index,
213  const CExperiment::Type & role);
214 
215  /**
216  * Retrieve the role of the indexed column
217  * @param const size_t & index
218  * @return CExperiment::Type role
219  */
220  CExperiment::Type getRole(const size_t & index) const;
221 
222  /**
223  * Set the object CN of the object mapped to the indexed column
224  * @param const size_t & index
225  * @param const std::string & objectCN
226  * @return bool success
227  */
228  bool setObjectCN(const size_t & index,
229  const std::string & objectCN);
230 
231  /**
232  * Retrieve the object CN of the object mapped to the indexed column
233  * @param const size_t & index
234  * @return std::stringobjctCN
235  */
236  std::string getObjectCN(const size_t & index) const;
237 
238  /**
239  * Set the scaling factor for the indexed column
240  * @param const size_t & index
241  * @param const C_FLOAT64 & scale
242  * @return bool success
243  */
244  bool setScale(const size_t & index,
245  const C_FLOAT64 & scale);
246 
247  /**
248  * Retrieve the scaling factor of the indexed column
249  * @param const size_t & index
250  * @return C_FLOAT64 scale
251  */
252  C_FLOAT64 getScale(const size_t & index) const;
253 
254  /**
255  * Retrieve the default scaling factor according to the selected weight method
256  * of the indexed column
257  * @param const size_t & index
258  * @return C_FLOAT64 defaultScale
259  */
260  C_FLOAT64 getDefaultScale(const size_t & index) const;
261 
262  /**
263  * Compile the map. This function must be called
264  * before any operations can be performed.
265  * @param const std::vector< CCopasiContainer * > listOfContainer
266  * @return bool success
267  */
268  bool compile(const std::vector< CCopasiContainer * > listOfContainer =
270 
271  /**
272  * Retrieve the vector of mapped objects
273  * @return const CVector< CCopasiObject * > & mappedObjects
274  */
276 
277  /**
278  * Retrieve the last mapped column number
279  * @return const size_t & lastColumn
280  */
281  const size_t & getLastColumn() const;
282 
283  /**
284  * Fix files written with Version 4.10.55, which wrote the square root of user defined weights for the
285  * parameter fitting task
286  */
287  void fixBuild55();
288 
289 private:
290  /**
291  * A vector of pointer to the objects corresponding
292  * to the data column.
293  */
295 
296  /**
297  * The last mapped column
298  */
299  size_t mLastColumn;
300 };
301 
302 #endif // COPASI_CExperimentObjectMap
C_FLOAT64 getScale(const size_t &index) const
bool setScale(const size_t &index, const C_FLOAT64 &scale)
bool compile(const std::vector< CCopasiContainer * > listOfContainer=CCopasiContainer::EmptyList)
CExperiment::Type getRole(const size_t &index) const
C_FLOAT64 getDefaultScale(const size_t &index) const
const CExperiment::Type & getRole() const
CExperimentObjectMap(const std::string &name="Object Map", const CCopasiContainer *pParent=NULL)
virtual const std::string & getName(const size_t &index) const
CDataColumn(const std::string &name="Object Map", const CCopasiContainer *pParent=NULL)
const CVector< CCopasiObject * > & getMappedObjects() const
bool setRole(const CExperiment::Type &role)
static const std::vector< CCopasiContainer * > EmptyList
const size_t & getLastColumn() const
bool setRole(const size_t &index, const CExperiment::Type &role)
CDataColumn & operator=(const CDataColumn &rhs)
#define C_FLOAT64
Definition: copasi.h:92
CVector< CCopasiObject * > mObjects
bool setObjectCN(const std::string &objectCN)
bool setScale(const C_FLOAT64 &scale)
std::string getObjectCN(const size_t &index) const
bool setNumCols(const size_t &numCols)
bool setObjectCN(const size_t &index, const std::string &objectCN)
size_t getLastNotIgnoredColumn() const