COPASI API  4.16.103
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CExperimentObjectMap::CDataColumn Class Reference

#include <CExperimentObjectMap.h>

Inheritance diagram for CExperimentObjectMap::CDataColumn:
Inheritance graph
[legend]
Collaboration diagram for CExperimentObjectMap::CDataColumn:
Collaboration graph
[legend]

Public Member Functions

 CDataColumn (const std::string &name="Object Map", const CCopasiContainer *pParent=NULL)
 
 CDataColumn (const CDataColumn &src, const CCopasiContainer *pParent=NULL)
 
 CDataColumn (const CCopasiParameterGroup &group, const CCopasiContainer *pParent=NULL)
 
virtual bool elevateChildren ()
 
void fixBuild55 ()
 
C_FLOAT64 getDefaultScale () const
 
std::string getObjectCN () const
 
const CExperiment::TypegetRole () const
 
C_FLOAT64 getScale () const
 
CDataColumnoperator= (const CDataColumn &rhs)
 
bool setObjectCN (const std::string &objectCN)
 
bool setRole (const CExperiment::Type &role)
 
bool setScale (const C_FLOAT64 &scale)
 
virtual ~CDataColumn ()
 
- Public Member Functions inherited from CCopasiParameterGroup
bool addGroup (const std::string &name)
 
bool addParameter (const CCopasiParameter &parameter)
 
bool addParameter (const std::string &name, const CCopasiParameter::Type type)
 
template<class CType >
bool addParameter (const std::string &name, const CCopasiParameter::Type type, const CType &value)
 
void addParameter (CCopasiParameter *pParameter)
 
CCopasiParameterGroupassertGroup (const std::string &name)
 
template<class CType >
CCopasiParameterassertParameter (const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
 
index_iterator beginIndex () const
 
name_iterator beginName () const
 
 CCopasiParameterGroup (const CCopasiParameterGroup &src, const CCopasiContainer *pParent=NULL)
 
 CCopasiParameterGroup (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &objectType="ParameterGroup")
 
void clear ()
 
index_iterator endIndex () const
 
name_iterator endName () const
 
CCopasiParameterGroupgetGroup (const std::string &name)
 
const CCopasiParameterGroupgetGroup (const std::string &name) const
 
CCopasiParameterGroupgetGroup (const size_t &index)
 
const CCopasiParameterGroupgetGroup (const size_t &index) const
 
size_t getIndex (const std::string &name) const
 
std::string getKey (const std::string &name) const
 
std::string getKey (const size_t &index) const
 
virtual const std::string & getName (const size_t &index) const
 
virtual const CObjectInterfacegetObject (const CCopasiObjectName &cn) const
 
CCopasiParametergetParameter (const std::string &name)
 
const CCopasiParametergetParameter (const std::string &name) const
 
CCopasiParametergetParameter (const size_t &index)
 
const CCopasiParametergetParameter (const size_t &index) const
 
CCopasiParameter::Type getType (const std::string &name) const
 
CCopasiParameter::Type getType (const size_t &index) const
 
std::string getUniqueParameterName (const CCopasiParameter *pParameter) const
 
const CCopasiParameter::ValuegetValue (const std::string &name) const
 
const CCopasiParameter::ValuegetValue (const size_t &index) const
 
CCopasiParameter::ValuegetValue (const std::string &name)
 
CCopasiParameter::ValuegetValue (const size_t &index)
 
CCopasiParameterGroupoperator= (const CCopasiParameterGroup &rhs)
 
virtual void print (std::ostream *ostream) const
 
bool removeParameter (const std::string &name)
 
bool removeParameter (const size_t &index)
 
template<class CType >
bool setValue (const std::string &name, const CType &value)
 
template<class CType >
bool setValue (const size_t &index, const CType &value)
 
size_t size () const
 
bool swap (const size_t &iFrom, const size_t &iTo)
 
bool swap (index_iterator &from, index_iterator &to)
 
virtual ~CCopasiParameterGroup ()
 
- Public Member Functions inherited from CCopasiParameter
 CCopasiParameter (const CCopasiParameter &src, const CCopasiContainer *pParent=NULL)
 
 CCopasiParameter (const std::string &name, const Type &type, const void *pValue=NULL, const CCopasiContainer *pParent=NULL, const std::string &objectType="Parameter")
 
virtual CCopasiObjectName getCN () const
 
virtual const std::string & getKey () const
 
virtual std::string getObjectDisplayName (bool regular=true, bool richtext=false) const
 
const CCopasiParameter::TypegetType () const
 
const ValuegetValue () const
 
ValuegetValue ()
 
virtual voidgetValuePointer () const
 
CCopasiObjectgetValueReference () const
 
bool isValidValue (const C_FLOAT64 &value) const
 
bool isValidValue (const C_INT32 &value) const
 
bool isValidValue (const unsigned C_INT32 &value) const
 
bool isValidValue (const bool &value) const
 
bool isValidValue (const std::string &value) const
 
bool isValidValue (const CCopasiObjectName &value) const
 
bool isValidValue (const std::vector< CCopasiParameter * > &value) const
 
CCopasiParameteroperator= (const CCopasiParameter &rhs)
 
template<class CType >
bool setValue (const CType &value)
 
bool setValue (const std::vector< CCopasiParameter * > &value)
 
virtual ~CCopasiParameter ()
 
- Public Member Functions inherited from CCopasiContainer
virtual bool add (CCopasiObject *pObject, const bool &adopt=true)
 
 CCopasiContainer (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=CCopasiObject::Container)
 
 CCopasiContainer (const CCopasiContainer &src, const CCopasiContainer *pParent=NULL)
 
virtual std::string getChildObjectUnits (const CCopasiObject *pObject) const
 
virtual const objectMapgetObjects () const
 
virtual std::string getUnits () const
 
virtual const CCopasiObjectgetValueObject () const
 
virtual bool remove (CCopasiObject *pObject)
 
virtual ~CCopasiContainer ()
 
- Public Member Functions inherited from CCopasiObject
void addDirectDependency (const CCopasiObject *pObject)
 
 CCopasiObject (const CCopasiObject &src, const CCopasiContainer *pParent=NULL)
 
void clearDirectDependencies ()
 
void clearRefresh ()
 
bool dependsOn (DataObjectSet candidates, const DataObjectSet &context=DataObjectSet()) const
 
void getAllDependencies (DataObjectSet &dependencies, const DataObjectSet &context) const
 
virtual const DataObjectSetgetDirectDependencies (const DataObjectSet &context=DataObjectSet()) const
 
CCopasiContainergetObjectAncestor (const std::string &type) const
 
CCopasiDataModelgetObjectDataModel ()
 
const CCopasiDataModelgetObjectDataModel () const
 
const std::string & getObjectName () const
 
CCopasiContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const
CObjectInterface::ObjectSet
getPrerequisites () const
 
virtual RefreshgetRefresh () const
 
UpdateMethodgetUpdateMethod () const
 
bool hasCircularDependencies (DataObjectSet &candidates, DataObjectSet &verified, const DataObjectSet &context) const
 
bool hasUpdateMethod () const
 
bool isArray () const
 
bool isContainer () const
 
bool isDataModel () const
 
bool isMatrix () const
 
bool isNameVector () const
 
bool isNonUniqueName () const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
 
bool isReference () const
 
bool isRoot () const
 
bool isSeparator () const
 
bool isStaticString () const
 
bool isValueBool () const
 
bool isValueDbl () const
 
bool isValueInt () const
 
bool isValueInt64 () const
 
bool isValueString () const
 
bool isVector () const
 
virtual bool mustBeDeleted (const DataObjectSet &deletedObjects) const
 
void removeDirectDependency (const CCopasiObject *pObject)
 
void setDirectDependencies (const DataObjectSet &directDependencies)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CCopasiContainer *pParent)
 
void setObjectValue (const C_FLOAT64 &value)
 
void setObjectValue (const C_INT32 &value)
 
void setObjectValue (const bool &value)
 
template<class CType >
void setRefresh (CType *pType, void(CType::*method)(void))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_FLOAT64 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const C_INT32 &))
 
template<class CType >
void setUpdateMethod (CType *pType, void(CType::*method)(const bool &))
 
virtual ~CCopasiObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
virtual ~CObjectInterface ()
 

Private Member Functions

void initializeParameter ()
 

Private Attributes

CCopasiObjectNamempObjectCN
 
CExperiment::TypempRole
 
C_FLOAT64mpScale
 

Additional Inherited Members

- Public Types inherited from CCopasiParameterGroup
typedef parameterGroup::iterator index_iterator
 
typedef
CCopasiContainer::objectMap::iterator 
name_iterator
 
typedef std::vector
< CCopasiParameter * > 
parameterGroup
 
- Public Types inherited from CCopasiParameter
enum  Type {
  DOUBLE = 0, UDOUBLE, INT, UINT,
  BOOL, GROUP, STRING, CN,
  KEY, FILE, EXPRESSION, INVALID
}
 
- Public Types inherited from CCopasiContainer
typedef std::multimap
< std::string, CCopasiObject * > 
objectMap
 
- Public Types inherited from CCopasiObject
typedef std::set< const
CCopasiObject * > 
DataObjectSet
 
typedef std::vector< Refresh * > DataUpdateSequence
 
- Public Types inherited from CObjectInterface
typedef std::set< const
CObjectInterface * > 
ObjectSet
 
typedef std::vector
< CObjectInterface * > 
UpdateSequence
 
- Static Public Member Functions inherited from CCopasiObject
static std::vector< Refresh * > buildUpdateSequence (const DataObjectSet &objects, const DataObjectSet &uptoDateObjects, const DataObjectSet &context=DataObjectSet())
 
static void setRenameHandler (CRenameHandler *rh)
 
- Static Public Attributes inherited from CCopasiParameter
static const std::string TypeName []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiContainer
static const std::vector
< CCopasiContainer * > 
EmptyList
 
- Protected Types inherited from CCopasiObject
enum  Flag {
  Container = 0x1, Vector = 0x2, Matrix = 0x4, NameVector = 0x8,
  Reference = 0x10, ValueBool = 0x20, ValueInt = 0x40, ValueInt64 = 0x80,
  ValueDbl = 0x100, NonUniqueName = 0x200, StaticString = 0x400, ValueString = 0x800,
  Separator = 0x1000, ModelEntity = 0x2000, Array = 0x4000, DataModel = 0x8000,
  Root = 0x10000, Gui = 0x20000
}
 
- Protected Member Functions inherited from CCopasiParameterGroup
 CCopasiParameterGroup ()
 
- Protected Member Functions inherited from CCopasiContainer
template<class CType >
CCopasiObjectaddMatrixReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddObjectReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
template<class CType >
CCopasiObjectaddVectorReference (const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
 
void initObjects ()
 
- Protected Member Functions inherited from CCopasiObject
 CCopasiObject ()
 
 CCopasiObject (const std::string &name, const CCopasiContainer *pParent=NULL, const std::string &type="CN", const unsigned C_INT32 &flag=0)
 
- Protected Attributes inherited from CCopasiParameter
std::string mKey
 
CCopasiObjectmpValueReference
 
size_t mSize
 
Value mValue
 
- Protected Attributes inherited from CCopasiContainer
objectMap mObjects
 
- Static Protected Attributes inherited from CCopasiObject
static CRenameHandlersmpRenameHandler = NULL
 

Detailed Description

Definition at line 27 of file CExperimentObjectMap.h.

Constructor & Destructor Documentation

CExperimentObjectMap::CDataColumn::CDataColumn ( const std::string &  name = "Object Map",
const CCopasiContainer pParent = NULL 
)

Default constructor

Parameters
conststd::string & name (default: Object Map)
constCCopasiContainer * pParent (default: NULL)

Definition at line 289 of file CExperimentObjectMap.cpp.

References initializeParameter().

290  :
291  CCopasiParameterGroup(name, pParent),
292  mpRole(NULL),
293  mpObjectCN(NULL),
294  mpScale(NULL)
295 {
297 }
CExperimentObjectMap::CDataColumn::CDataColumn ( const CDataColumn src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
constCDataColumn & src
constCCopasiContainer * pParent (default: NULL)

Definition at line 299 of file CExperimentObjectMap.cpp.

References initializeParameter().

300  :
301  CCopasiParameterGroup(src, pParent),
302  mpRole(NULL),
303  mpObjectCN(NULL),
304  mpScale(NULL)
305 {
307 }
CExperimentObjectMap::CDataColumn::CDataColumn ( const CCopasiParameterGroup group,
const CCopasiContainer pParent = NULL 
)

Specific constructor used for reading COPASI files

Parameters
constCCopasiParameterGroup & group
constCCopasiContainer * pParent (default: NULL)

Definition at line 309 of file CExperimentObjectMap.cpp.

References initializeParameter().

310  :
311  CCopasiParameterGroup(group, pParent),
312  mpRole(NULL),
313  mpObjectCN(NULL),
314  mpScale(NULL)
315 {
317 }
CExperimentObjectMap::CDataColumn::~CDataColumn ( )
virtual

Destructor

Definition at line 319 of file CExperimentObjectMap.cpp.

320 {}

Member Function Documentation

bool CExperimentObjectMap::CDataColumn::elevateChildren ( )
virtual

This methods must be called to elevate subgroups to derived objects. The default implementation does nothing.

Returns
bool success

Reimplemented from CCopasiParameterGroup.

Definition at line 349 of file CExperimentObjectMap.cpp.

350 {return true;}
void CExperimentObjectMap::CDataColumn::fixBuild55 ( )

Fix files written with Version 4.10.55, which wrote the square root of user defined weights for the parameter fitting task

Definition at line 460 of file CExperimentObjectMap.cpp.

Referenced by CExperimentObjectMap::fixBuild55().

461 {
462  if (mpScale != NULL)
463  {
464  *mpScale *= *mpScale;
465  }
466 }
C_FLOAT64 CExperimentObjectMap::CDataColumn::getDefaultScale ( ) const

Retrieve the default weight of the column

Returns
C_FLOAT64 defaultScale

Definition at line 433 of file CExperimentObjectMap.cpp.

References CCopasiDataModel::getDataObject(), CExperiment::getDefaultScale(), CCopasiObject::getObjectDataModel(), and CCopasiObject::getObjectParent().

Referenced by CExperimentObjectMap::getDefaultScale().

434 {
435  if (mpObjectCN == NULL)
436  return std::numeric_limits<C_FLOAT64>::quiet_NaN();
437 
438  CCopasiParameterGroup *pGroup =
439  dynamic_cast< CCopasiParameterGroup * >(getObjectParent());
440 
441  if (pGroup == NULL)
442  return std::numeric_limits<C_FLOAT64>::quiet_NaN();
443 
444  const CExperiment *pExperiment =
445  dynamic_cast<const CExperiment * >(pGroup->getObjectParent());
446 
447  if (pExperiment == NULL)
448  return std::numeric_limits<C_FLOAT64>::quiet_NaN();
449 
450  const CCopasiDataModel* pDataModel = getObjectDataModel();
451  assert(pDataModel != NULL);
452  const CCopasiObject * pObject = pDataModel->getDataObject(*mpObjectCN);
453 
454  if (pObject == NULL)
455  return std::numeric_limits<C_FLOAT64>::quiet_NaN();
456 
457  return pExperiment->getDefaultScale(pObject);
458 }
CCopasiDataModel * getObjectDataModel()
CCopasiObject * getDataObject(const CCopasiObjectName &CN) const
C_FLOAT64 getDefaultScale(const CCopasiObject *const &pObject) const
CCopasiContainer * getObjectParent() const
std::string CExperimentObjectMap::CDataColumn::getObjectCN ( ) const

Retrieve the object CN of the object mapped to the column

Returns
std::string objctCN

Definition at line 383 of file CExperimentObjectMap.cpp.

Referenced by CExperimentObjectMap::getObjectCN(), and operator=().

384 {
385  if (mpObjectCN != NULL)
386  return *mpObjectCN;
387  else
388  return "";
389 }
const CExperiment::Type & CExperimentObjectMap::CDataColumn::getRole ( ) const

Retrieve the role of the column

Returns
const CExperiment::Type & role

Definition at line 358 of file CExperimentObjectMap.cpp.

Referenced by CExperimentObjectMap::getRole().

359 {return *mpRole;}
C_FLOAT64 CExperimentObjectMap::CDataColumn::getScale ( ) const

Retrieve the scaling factor of the column

Returns
C_FLOAT64 scale

Definition at line 425 of file CExperimentObjectMap.cpp.

References CExperimentObjectMap::getDefaultScale().

Referenced by CExperimentObjectMap::getScale(), and operator=().

426 {
427  if (mpScale == NULL)
428  return getDefaultScale();
429  else
430  return *mpScale;
431 }
void CExperimentObjectMap::CDataColumn::initializeParameter ( )
private

Allocates all group parameters and assures that they are properly initialized.

Definition at line 322 of file CExperimentObjectMap.cpp.

References CCopasiParameterGroup::assertParameter(), C_INT32, CExperimentObjectMap::elevateChildren(), CCopasiParameterGroup::getParameter(), CCopasiParameter::getValue(), CExperiment::ignore, CCopasiParameter::Value::pCN, CCopasiParameter::Value::pUDOUBLE, CCopasiParameter::Value::pUINT, and CCopasiParameter::UINT.

Referenced by CDataColumn().

323 {
326 
327  CCopasiParameter * pParm = getParameter("Object CN");
328 
329  if (pParm != NULL)
330  mpObjectCN = pParm->getValue().pCN;
331 
332  pParm = getParameter("Weight");
333 
334  if (pParm != NULL)
335  mpScale = pParm->getValue().pUDOUBLE;
336 
337  elevateChildren();
338 }
#define C_INT32
Definition: copasi.h:90
CRegisteredObjectName * pCN
const Value & getValue() const
unsigned C_INT32 * pUINT
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
CExperimentObjectMap::CDataColumn & CExperimentObjectMap::CDataColumn::operator= ( const CDataColumn rhs)

Assignment operator

Parameters
constCDataColumn & rhs
Returns
CDataColumn & lhs

Definition at line 340 of file CExperimentObjectMap.cpp.

References getObjectCN(), getScale(), mpRole, CExperimentObjectMap::setObjectCN(), and CExperimentObjectMap::setScale().

341 {
342  *mpRole = *rhs.mpRole;
343  setObjectCN(rhs.getObjectCN());
344  setScale(rhs.getScale());
345 
346  return *this;
347 }
bool setObjectCN(const std::string &objectCN)
bool setScale(const C_FLOAT64 &scale)
bool CExperimentObjectMap::CDataColumn::setObjectCN ( const std::string &  objectCN)

Set the object CN of the object mapped to the column

Parameters
conststd::string & objectCN
Returns
bool success

Definition at line 361 of file CExperimentObjectMap.cpp.

References CCopasiParameterGroup::assertParameter(), CCopasiParameter::CN, CCopasiParameter::getValue(), CCopasiParameter::Value::pCN, and CCopasiParameterGroup::removeParameter().

Referenced by CExperimentObjectMap::setObjectCN().

362 {
363  if (objectCN == "")
364  {
365  if (mpObjectCN != NULL)
366  {
367  removeParameter("Object CN");
368  mpObjectCN = NULL;
369  }
370  }
371  else
372  {
373  if (mpObjectCN != NULL)
374  *mpObjectCN = objectCN;
375  else
376  mpObjectCN =
378  }
379 
380  return true;
381 }
CRegisteredObjectName * pCN
bool removeParameter(const std::string &name)
const Value & getValue() const
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
bool CExperimentObjectMap::CDataColumn::setRole ( const CExperiment::Type role)

Set the role of the column

Parameters
constCExperiment::Type & role
Returns
bool success

Definition at line 352 of file CExperimentObjectMap.cpp.

Referenced by CExperimentObjectMap::setRole().

353 {
354  *mpRole = role;
355  return true;
356 }
bool CExperimentObjectMap::CDataColumn::setScale ( const C_FLOAT64 scale)

Set the scaling factor for the column

Parameters
constC_FLOAT64 & scale
Returns
bool success

Definition at line 391 of file CExperimentObjectMap.cpp.

References CCopasiParameterGroup::assertParameter(), C_FLOAT64, CExperimentObjectMap::getDefaultScale(), CCopasiParameter::getValue(), CCopasiParameter::Value::pUDOUBLE, CCopasiParameterGroup::removeParameter(), and CCopasiParameter::UDOUBLE.

Referenced by CExperimentObjectMap::setScale().

392 {
393  if (isnan(weight))
394  {
395  if (mpScale != NULL)
396  {
397  removeParameter("Weight");
398  mpScale = NULL;
399  }
400 
401  return true;
402  }
403 
404  C_FLOAT64 DefaultWeight = getDefaultScale();
405 
406  if (weight != DefaultWeight || isnan(DefaultWeight))
407  {
408  if (mpScale != NULL)
409  *mpScale = weight;
410  else
412 
413  return true;
414  }
415 
416  if (mpScale != NULL)
417  {
418  removeParameter("Weight");
419  mpScale = NULL;
420  }
421 
422  return true;
423 }
bool removeParameter(const std::string &name)
const Value & getValue() const
#define C_FLOAT64
Definition: copasi.h:92
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)

Member Data Documentation

CCopasiObjectName* CExperimentObjectMap::CDataColumn::mpObjectCN
private

Definition at line 136 of file CExperimentObjectMap.h.

CExperiment::Type* CExperimentObjectMap::CDataColumn::mpRole
private

Definition at line 134 of file CExperimentObjectMap.h.

Referenced by operator=().

C_FLOAT64* CExperimentObjectMap::CDataColumn::mpScale
private

Definition at line 138 of file CExperimentObjectMap.h.


The documentation for this class was generated from the following files: