COPASI API  4.16.103
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
CCopasiParameterGroup Class Reference

#include <CCopasiParameterGroup.h>

Inheritance diagram for CCopasiParameterGroup:
Inheritance graph
[legend]
Collaboration diagram for CCopasiParameterGroup:
Collaboration graph
[legend]

Public Types

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
 

Public Member Functions

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 ()
 
virtual bool elevateChildren ()
 
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 ()
 

Protected Member Functions

 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)
 

Friends

std::ostream & operator<< (std::ostream &os, const CCopasiParameterGroup &o)
 
bool operator== (const CCopasiParameterGroup &lhs, const CCopasiParameterGroup &rhs)
 

Additional Inherited Members

- 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 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

CCopasiParameterGroup class. This class is used to describe parameters. This class is intended to be used with integration or optimization methods or reactions.

Created for COPASI by Stefan Hoops 2002

Definition at line 34 of file CCopasiParameterGroup.h.

Member Typedef Documentation

typedef parameterGroup::iterator CCopasiParameterGroup::index_iterator

Definition at line 38 of file CCopasiParameterGroup.h.

typedef CCopasiContainer::objectMap::iterator CCopasiParameterGroup::name_iterator

Definition at line 39 of file CCopasiParameterGroup.h.

Definition at line 37 of file CCopasiParameterGroup.h.

Constructor & Destructor Documentation

CCopasiParameterGroup::CCopasiParameterGroup ( )
protected

Default constructor

CCopasiParameterGroup class. This class is used to describe parameters. This class is intended to be used with integration or optimization methods or reactions.

Created for COPASI by Stefan Hoops 2002

Definition at line 32 of file CCopasiParameterGroup.cpp.

Referenced by addGroup(), addParameter(), CScanProblem::createScanItem(), operator=(), CMIRIAMResources::updateMIRIAMResources(), and CMIRIAMResources::updateMIRIAMResourcesFromFile().

CCopasiParameterGroup::CCopasiParameterGroup ( const CCopasiParameterGroup src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters
const CCopasiParameterGroup &src
constCCopasiContainer * pParent (default: NULL)

Definition at line 36 of file CCopasiParameterGroup.cpp.

37  :
38  CCopasiParameter(src, pParent)
39 {
40  *this = src;
41 }
CCopasiParameterGroup::CCopasiParameterGroup ( const std::string &  name,
const CCopasiContainer pParent = NULL,
const std::string &  objectType = "ParameterGroup" 
)

Specific constructor

Parameters
conststring & name
constCCopasiContainer * pParent (default: NULL)
conststd::string & objectType (default: "ParameterGroup")

Definition at line 43 of file CCopasiParameterGroup.cpp.

CCopasiParameterGroup::~CCopasiParameterGroup ( )
virtual

Destructor

Definition at line 49 of file CCopasiParameterGroup.cpp.

References clear().

50 {
51  clear();
52 }

Member Function Documentation

bool CCopasiParameterGroup::addGroup ( const std::string &  name)

Add a subgroup to the group

Parameters
conststd::string & name
Returns
bool success

Definition at line 291 of file CCopasiParameterGroup.cpp.

References addParameter(), and CCopasiParameterGroup().

Referenced by CSensProblem::addVariables(), assertGroup(), CSensProblem::CSensProblem(), and CScanProblem::initializeParameter().

292 {
294  return true;
295 }
bool addParameter(const CCopasiParameter &parameter)
bool CCopasiParameterGroup::addParameter ( const CCopasiParameter parameter)

Add a parameter

Parameters
constCCopasiParameter & parameter
Returns
bool success

Definition at line 239 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::CCopasiParameter(), CCopasiParameterGroup(), CCopasiParameter::getType(), and CCopasiParameter::GROUP.

Referenced by CFitItem::addCrossValidation(), CMIRIAMResource::addDeprecatedURL(), CExperimentSet::addExperiment(), CFitItem::addExperiment(), CRecentFiles::addFile(), addGroup(), CMIRIAMResources::addMIRIAMResource(), COptProblem::addOptItem(), addParameter(), CScanProblem::addScanItem(), assertParameter(), CLNAProblem::CLNAProblem(), CMCAProblem::CMCAProblem(), COptMethodCoranaWalk::COptMethodCoranaWalk(), COptMethodDE::COptMethodDE(), COptMethodEP::COptMethodEP(), COptMethodEP2::COptMethodEP2(), COptMethodGA::COptMethodGA(), COptMethodGASR::COptMethodGASR(), COptMethodHGASA::COptMethodHGASA(), COptMethodHookeJeeves::COptMethodHookeJeeves(), COptMethodLevenbergMarquardt::COptMethodLevenbergMarquardt(), COptMethodNelderMead::COptMethodNelderMead(), COptMethodPraxis::COptMethodPraxis(), COptMethodPS::COptMethodPS(), COptMethodSA::COptMethodSA(), COptMethodSRES::COptMethodSRES(), COptMethodSS::COptMethodSS(), COptMethodSteepestDescent::COptMethodSteepestDescent(), CRandomSearch::CRandomSearch(), SBMLImporter::createCReactionFromReaction(), CSensProblem::createParametersInGroup(), CScanProblem::createScanItem(), CSensMethod::CSensMethod(), CSensProblem::CSensProblem(), CSteadyStateProblem::CSteadyStateProblem(), CScanProblem::initializeParameter(), CHybridMethodODE45::initializeParameter(), CHybridMethodLSODA::initializeParameter(), CReaction::initializeParameters(), operator=(), CQFittingItemWidget::save(), CMIRIAMResources::updateMIRIAMResources(), and CMIRIAMResources::updateMIRIAMResourcesFromFile().

240 {
241  if (parameter.getType() == CCopasiParameter::GROUP)
242  {
243  CCopasiParameterGroup * pGroup =
244  new CCopasiParameterGroup(*dynamic_cast<const CCopasiParameterGroup *>(&parameter));
245  addParameter(pGroup);
246  }
247  else
248  {
249  CCopasiParameter * pParameter = new CCopasiParameter(parameter);
250  addParameter(pParameter);
251  }
252 
253  return true;
254 }
const CCopasiParameter::Type & getType() const
bool addParameter(const CCopasiParameter &parameter)
bool CCopasiParameterGroup::addParameter ( const std::string &  name,
const CCopasiParameter::Type  type 
)

Add a parameter to the group

Parameters
conststd::string & name
constCCopasiParameter::Type type
Returns
bool success

Definition at line 276 of file CCopasiParameterGroup.cpp.

References addParameter(), CCopasiParameter::CCopasiParameter(), CCopasiParameterGroup(), and CCopasiParameter::GROUP.

278 {
279  CCopasiParameter * pParameter;
280 
281  if (type == GROUP)
282  pParameter = new CCopasiParameterGroup(name);
283  else
284  pParameter = new CCopasiParameter(name, type);
285 
286  addParameter(pParameter);
287 
288  return true;
289 }
bool addParameter(const CCopasiParameter &parameter)
template<class CType >
bool CCopasiParameterGroup::addParameter ( const std::string &  name,
const CCopasiParameter::Type  type,
const CType &  value 
)
inline

Add a parameter to the group

Parameters
conststd::string & name
constCCopasiParameter::Type type
constCType & value
Returns
bool success

Definition at line 138 of file CCopasiParameterGroup.h.

References addParameter(), CCopasiParameter::CCopasiParameter(), CCopasiParameterGroup(), CCopasiParameter::GROUP, CCopasiParameter::isValidValue(), CCopasiParameter::mValue, CCopasiParameter::Value::pGROUP, and CCopasiParameter::setValue().

141  {
142  CCopasiParameter * pParameter;
143 
144  if (type == GROUP)
145  {
147 
148  if (!tmp->isValidValue(value))
149  {
150  delete tmp;
151  return false;
152  }
153 
154  parameterGroup *pGroup = tmp->mValue.pGROUP;
155  tmp->mValue.pGROUP =
156  static_cast<parameterGroup *>(const_cast<void *>((const void *) & value));
157 
158  pParameter = new CCopasiParameterGroup(*tmp);
159 
160  tmp->mValue.pGROUP = pGroup;
161  delete tmp;
162  }
163  else
164  {
165  pParameter = new CCopasiParameter(name, type);
166 
167  if (!pParameter->isValidValue(value))
168  {
169  delete pParameter;
170  return false;
171  }
172 
173  pParameter->setValue(value);
174  }
175 
176  addParameter(pParameter);
177 
178  return true;
179  }
bool setValue(const CType &value)
bool isValidValue(const C_FLOAT64 &value) const
std::vector< CCopasiParameter * > * pGROUP
std::vector< CCopasiParameter * > parameterGroup
bool addParameter(const CCopasiParameter &parameter)
void CCopasiParameterGroup::addParameter ( CCopasiParameter pParameter)

Add a parameter

Parameters
CCopasiParameter* pParameter

Definition at line 256 of file CCopasiParameterGroup.cpp.

References CCopasiContainer::add(), CCopasiParameter::mValue, and CCopasiParameter::Value::pGROUP.

257 {
258  if (pParameter == NULL) return;
259 
260  CCopasiContainer::add(pParameter, true);
261  mValue.pGROUP->push_back(pParameter);
262 }
std::vector< CCopasiParameter * > * pGROUP
virtual bool add(CCopasiObject *pObject, const bool &adopt=true)
CCopasiParameterGroup * CCopasiParameterGroup::assertGroup ( const std::string &  name)

Assert that a group with the given name is present. If not the group is created as empty group.

Parameters
conststd::string & name
Returns
CCopasiParameterGroup * pGroup

Definition at line 297 of file CCopasiParameterGroup.cpp.

References addGroup(), getGroup(), and removeParameter().

Referenced by CConfigurationFile::CXML::CXML(), CExperimentObjectMap::elevateChildren(), CRecentFiles::initializeParameter(), CMIRIAMResource::initializeParameter(), CFitItem::initializeParameter(), CConfigurationFile::initializeParameter(), CFitProblem::initializeParameter(), CMIRIAMResources::initializeParameter(), COptProblem::initializeParameter(), CExperiment::initializeParameter(), and CExperimentObjectMap::setNumCols().

298 {
299  CCopasiParameterGroup * pGrp = getGroup(name);
300 
301  if (pGrp) return pGrp;
302 
303  removeParameter(name);
304 
305  addGroup(name);
306  return getGroup(name);
307 }
bool removeParameter(const std::string &name)
bool addGroup(const std::string &name)
CCopasiParameterGroup * getGroup(const std::string &name)
template<class CType >
CCopasiParameter* CCopasiParameterGroup::assertParameter ( const std::string &  name,
const CCopasiParameter::Type  type,
const CType &  defaultValue 
)
inline

Assert that a parameter with the given name and type is present. If not the parameter is created with the default value.

Parameters
conststd::string & name
constCCopasiParameter::Type type
constCType & Value
Returns
CCopasiParameter * pParameter

Definition at line 190 of file CCopasiParameterGroup.h.

References addParameter(), getParameter(), CCopasiParameter::getType(), and removeParameter().

Referenced by CFitProblem::elevateChildren(), CExperimentObjectMap::elevateChildren(), CTSSAMethod::initializeIntegrationsParameter(), CExperimentObjectMap::CDataColumn::initializeParameter(), CRecentFiles::initializeParameter(), CILDMMethod::initializeParameter(), CILDMModifiedMethod::initializeParameter(), CSteadyStateMethod::initializeParameter(), CMIRIAMResource::initializeParameter(), CLyapProblem::initializeParameter(), CNewtonMethod::initializeParameter(), CTrajectoryProblem::initializeParameter(), CTSSAProblem::initializeParameter(), CMCAMethod::initializeParameter(), CCrossSectionProblem::initializeParameter(), CCSPMethod::initializeParameter(), CStochDirectMethod::initializeParameter(), CTrajAdaptiveSA::initializeParameter(), CHybridMethodODE45::initializeParameter(), CTauLeapMethod::initializeParameter(), CLyapWolfMethod::initializeParameter(), CStochMethod::initializeParameter(), CConfigurationFile::initializeParameter(), COptItem::initializeParameter(), CFitProblem::initializeParameter(), CLsodaMethod::initializeParameter(), CMIRIAMResources::initializeParameter(), CCrossValidationSet::initializeParameter(), CTrajectoryMethodDsaLsodar::initializeParameter(), COptProblem::initializeParameter(), CHybridMethod::initializeParameter(), CHybridMethodLSODA::initializeParameter(), CExperiment::initializeParameter(), CExperimentObjectMap::CDataColumn::setObjectCN(), CExperimentObjectMap::CDataColumn::setScale(), CPlotItem::setType(), and CCopasiXMLParser::TaskElement::start().

193  {
194  CCopasiParameter * pParm = getParameter(name);
195 
196  if (pParm && pParm->getType() == type) return pParm;
197 
198  if (pParm) removeParameter(name);
199 
200  addParameter(name, type, defaultValue);
201 
202  return getParameter(name);
203  }
bool removeParameter(const std::string &name)
const CCopasiParameter::Type & getType() const
CCopasiParameter * getParameter(const std::string &name)
bool addParameter(const CCopasiParameter &parameter)
CCopasiParameterGroup::index_iterator CCopasiParameterGroup::beginIndex ( ) const
CCopasiParameterGroup::name_iterator CCopasiParameterGroup::beginName ( ) const

Retrieve the begin of an alphabetically sorted iterator

Returns
name_iterator begin

Definition at line 264 of file CCopasiParameterGroup.cpp.

References CCopasiContainer::getObjects().

Referenced by operator=().

265 {return const_cast< CCopasiContainer::objectMap * >(&getObjects())->begin();}
virtual const objectMap & getObjects() const
std::multimap< std::string, CCopasiObject * > objectMap
void CCopasiParameterGroup::clear ( )
bool CCopasiParameterGroup::elevateChildren ( )
virtual
CCopasiParameterGroup::index_iterator CCopasiParameterGroup::endIndex ( ) const
CCopasiParameterGroup::name_iterator CCopasiParameterGroup::endName ( ) const

Retrieve the end of an alphabetically sorted iterator

Returns
name_iterator end

Definition at line 267 of file CCopasiParameterGroup.cpp.

References CCopasiContainer::getObjects().

Referenced by operator=().

268 {return const_cast< CCopasiContainer::objectMap * >(&getObjects())->end();}
virtual const objectMap & getObjects() const
std::multimap< std::string, CCopasiObject * > objectMap
CCopasiParameterGroup * CCopasiParameterGroup::getGroup ( const std::string &  name)
const CCopasiParameterGroup * CCopasiParameterGroup::getGroup ( const std::string &  name) const

Retrieve a subgroup from the group

Parameters
conststd::string & name
Returns
const CCopasiParameterGroup * group

Definition at line 386 of file CCopasiParameterGroup.cpp.

References getParameter().

387 {return dynamic_cast<const CCopasiParameterGroup *>(getParameter(name));}
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameterGroup * CCopasiParameterGroup::getGroup ( const size_t &  index)

Retrieve a subgroup from the group

Parameters
constsize_t & index
Returns
CCopasiParameterGroup * parameter

Definition at line 389 of file CCopasiParameterGroup.cpp.

References getParameter().

390 {return dynamic_cast<CCopasiParameterGroup *>(getParameter(index));}
CCopasiParameter * getParameter(const std::string &name)
const CCopasiParameterGroup * CCopasiParameterGroup::getGroup ( const size_t &  index) const

Retrieve a subgroup from the group

Parameters
constsize_t & index
Returns
const CCopasiParameterGroup * parameter

Definition at line 392 of file CCopasiParameterGroup.cpp.

References getParameter().

393 {return dynamic_cast<const CCopasiParameterGroup *>(getParameter(index));}
CCopasiParameter * getParameter(const std::string &name)
size_t CCopasiParameterGroup::getIndex ( const std::string &  name) const

Retrieve the index of a parameter or subgroup with a given name

Parameters
conststd::string & name
Returns
size_t index

Definition at line 528 of file CCopasiParameterGroup.cpp.

References C_INVALID_INDEX, CCopasiParameter::mValue, and CCopasiParameter::Value::pGROUP.

Referenced by getParameterValue(), removeParameter(), and setParameterValue().

529 {
530  index_iterator it = mValue.pGROUP->begin();
531  index_iterator end = mValue.pGROUP->end();
532 
533  for (size_t i = 0; it != end; ++it, ++i)
534  if (name == (*it)->getObjectName()) return i;;
535 
536  return C_INVALID_INDEX;
537 }
std::vector< CCopasiParameter * > * pGROUP
#define C_INVALID_INDEX
Definition: copasi.h:222
parameterGroup::iterator index_iterator
std::string CCopasiParameterGroup::getKey ( const std::string &  name) const

Retrieve the key of a parameter or subgroup

Parameters
conststd::string & name
Returns
std::string key

Definition at line 457 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::getKey(), and getParameter().

Referenced by CCopasiXML::saveModel().

458 {
459  CCopasiParameter * pParameter =
460  const_cast< CCopasiParameterGroup * >(this)->getParameter(name);
461 
462  if (pParameter) return pParameter->getKey();
463 
464  return "Not Found";
465 }
virtual const std::string & getKey() const
CCopasiParameter * getParameter(const std::string &name)
std::string CCopasiParameterGroup::getKey ( const size_t &  index) const

Retrieve the key of a parameter or subgroup

Parameters
constsize_t & index
Returns
std::string key

Definition at line 467 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::getKey(), and getParameter().

468 {
469  CCopasiParameter * pParameter =
470  const_cast< CCopasiParameterGroup * >(this)->getParameter(index);
471 
472  if (pParameter) return pParameter->getKey();
473 
474  return "Not Found";
475 }
virtual const std::string & getKey() const
CCopasiParameter * getParameter(const std::string &name)
const std::string & CCopasiParameterGroup::getName ( const size_t &  index) const
virtual

Retrieve the name of a parameter or subgroup

Parameters
constsize_t & index
Returns
std::string name

Reimplemented in CExperimentObjectMap.

Definition at line 477 of file CCopasiParameterGroup.cpp.

References CCopasiObject::getObjectName(), and getParameter().

Referenced by getParameterValue(), CQTaskMethodWidget::loadMethod(), CQMCAWidget::loadParameterTable(), CQLNAWidget::loadParameterTable(), CExperiment::read(), CExperiment::readColumnNames(), and CCopasiXML::saveModel().

478 {
479  static std::string Invalid("Invalid Index");
480 
481  CCopasiParameter * pParameter =
482  const_cast< CCopasiParameterGroup * >(this)->getParameter(index);
483 
484  if (pParameter) return pParameter->getObjectName();
485 
486  return Invalid;
487 }
const std::string & getObjectName() const
CCopasiParameter * getParameter(const std::string &name)
const CObjectInterface * CCopasiParameterGroup::getObject ( const CCopasiObjectName cn) const
virtual

Retrieve a descendant object by its CN.

Parameters
constCCopasiObjectName & cn
Returns
const CObjectInterface * pObject

Reimplemented from CCopasiContainer.

Definition at line 55 of file CCopasiParameterGroup.cpp.

References C_INVALID_INDEX, CCopasiContainer::getObject(), CCopasiObjectName::getObjectName(), CCopasiObjectName::getRemainder(), CCopasiParameter::mValue, CCopasiParameter::Value::pGROUP, and strToUnsignedInt().

Referenced by COutputAssistant::createDefaultOutput().

56 {
57  const CObjectInterface * pObjectInterface = CCopasiContainer::getObject(cn);
58 
59  if (pObjectInterface != NULL)
60  {
61  return pObjectInterface;
62  }
63 
64  std::string UniqueName = cn.getObjectName();
65 
66  std::string::size_type pos = UniqueName.find_last_of('[');
67  std::string Name = UniqueName.substr(0, pos);
68  size_t Index = strToUnsignedInt(UniqueName.substr(pos + 1).c_str());
69  size_t counter = C_INVALID_INDEX;
70 
71  index_iterator it = mValue.pGROUP->begin();
72  index_iterator end = mValue.pGROUP->end();
73 
74  for (; it != end; ++it)
75  {
76  if ((*it)->getObjectName() == Name)
77  {
78  counter++;
79 
80  if (counter == Index)
81  {
82  return (*it)->getObject(cn.getRemainder());
83  }
84  }
85  }
86 
87  return NULL;
88 }
CCopasiObjectName getRemainder() const
std::vector< CCopasiParameter * > * pGROUP
#define C_INVALID_INDEX
Definition: copasi.h:222
unsigned C_INT32 strToUnsignedInt(const char *str, char const **pTail)
Definition: utility.cpp:384
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
parameterGroup::iterator index_iterator
std::string getObjectName() const
CCopasiParameter * CCopasiParameterGroup::getParameter ( const std::string &  name)

Retrieve a parameter or subgroup from the group

Parameters
conststd::string & name
Returns
CCopasiParameter * parameter

Definition at line 343 of file CCopasiParameterGroup.cpp.

References CCopasiContainer::getObjects().

Referenced by CExperimentSet::addExperiment(), CSensProblem::addVariables(), assertParameter(), DataModelGUI::buildChangedObjects(), CModel::buildInitialRefreshSequence(), CModel::buildInitialSequence(), CSensProblem::changeVariables(), CModelAnalyzer::checkReaction(), CModel::convert2NonReversible(), CSEDMLExporter::createScanTask(), CSensProblem::CSensProblem(), CTrajectoryTask::CTrajectoryTask(), CTSSATask::CTSSATask(), CFitProblem::elevateChildren(), CFitItem::elevateChildren(), COptProblem::elevateChildren(), CCopasiXMLParser::PlotItemElement::end(), CCopasiXMLParser::PlotSpecificationElement::end(), CCopasiXMLParser::TaskElement::end(), CODEExporter::exportReacParamsAndFuncs(), CScanProblem::fixBuild81(), CPlotItem::getActivity(), CReactionInterface::getDeletedParameters(), getGroup(), getKey(), getName(), CScanProblem::getScanItem(), getType(), getValue(), CSensProblem::getVariables(), SEDMLImporter::importTasks(), CQPreferenceDialog::init(), CTrajectoryTask::initialize(), CTSSATask::initialize(), CCrossSectionTask::initialize(), CTSSAMethod::initializeIntegrationsParameter(), CExperimentObjectMap::CDataColumn::initializeParameter(), CSteadyStateMethod::initializeParameter(), CScanProblem::initializeParameter(), CNewtonMethod::initializeParameter(), CMCAMethod::initializeParameter(), CHybridMethodODE45::initializeParameter(), CLyapWolfMethod::initializeParameter(), CTauLeapMethod::initializeParameter(), CStochMethod::initializeParameter(), CLsodaMethod::initializeParameter(), CTrajectoryMethodDsaLsodar::initializeParameter(), CHybridMethod::initializeParameter(), CHybridMethodLSODA::initializeParameter(), CExperiment::initializeParameter(), CReaction::initializeParameters(), CTrajectoryProblem::initObjects(), CTSSAProblem::initObjects(), CReaction::isLocalParameter(), CTrajectoryTask::load(), CReactionInterface::loadMappingAndValues(), SBMLImporter::sbmlId2CopasiCN(), CTrajectoryTask::setMethodType(), CCrossSectionTask::setMethodType(), CReaction::setParameterValue(), setValue(), CQPreferenceDialog::slotBtnOk(), CCopasiXMLParser::ConstantElement::start(), SteadyStateWidget::taskFinishedEvent(), test000058::test_bug1025_1(), test000058::test_bug1025_6(), test000087::test_simulate_reaction_flux_reference_1(), test000059::test_unique_id_10(), test000059::test_unique_id_13(), test000059::test_unique_id_15(), test000059::test_unique_id_16(), test000059::test_unique_id_4(), test000059::test_unique_id_7(), test000059::test_unique_id_9(), and CQExperimentDataValidator::validate().

344 {
345  std::pair < CCopasiContainer::objectMap::const_iterator,
346  CCopasiContainer::objectMap::const_iterator > range =
347  getObjects().equal_range(name);
348 
349  if (range.first == range.second) return NULL;
350 
351  return
352  dynamic_cast<CCopasiParameter *>(const_cast< CCopasiObject * >(range.first->second));
353 }
virtual const objectMap & getObjects() const
const CCopasiParameter * CCopasiParameterGroup::getParameter ( const std::string &  name) const

Retrieve a parameter or subgroup from the group

Parameters
conststd::string & name
Returns
const CCopasiParameter * parameter

Definition at line 355 of file CCopasiParameterGroup.cpp.

References CCopasiContainer::getObjects().

356 {
357  std::pair < CCopasiContainer::objectMap::const_iterator,
358  CCopasiContainer::objectMap::const_iterator > range =
359  getObjects().equal_range(name);
360 
361  if (range.first == range.second) return NULL;
362 
363  return
364  dynamic_cast<CCopasiParameter *>(range.first->second);
365 }
virtual const objectMap & getObjects() const
CCopasiParameter * CCopasiParameterGroup::getParameter ( const size_t &  index)

Retrieve a parameter or subgroup from the group

Parameters
constsize_t & index
Returns
CCopasiParameter * parameter

Definition at line 367 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::mValue, CCopasiParameter::Value::pGROUP, and size().

368 {
369  if (index < size())
370  return *(mValue.pGROUP->begin() + index);
371 
372  return NULL;
373 }
std::vector< CCopasiParameter * > * pGROUP
const CCopasiParameter * CCopasiParameterGroup::getParameter ( const size_t &  index) const

Retrieve a parameter or subgroup from the group

Parameters
constsize_t & index
Returns
const CCopasiParameter * parameter

Definition at line 375 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::mValue, CCopasiParameter::Value::pGROUP, and size().

376 {
377  if (index < size())
378  return *(mValue.pGROUP->begin() + index);
379 
380  return NULL;
381 }
std::vector< CCopasiParameter * > * pGROUP
CCopasiParameter::Type CCopasiParameterGroup::getType ( const std::string &  name) const

Retrieve the type of a parameter or subgroup

Parameters
conststd::string & name
Returns
CCopasiParameter::Type

Definition at line 437 of file CCopasiParameterGroup.cpp.

References getParameter(), CCopasiParameter::getType(), and CCopasiParameter::INVALID.

Referenced by getParameterValue(), and setParameterValue().

438 {
439  CCopasiParameter * pParameter =
440  const_cast< CCopasiParameterGroup * >(this)->getParameter(name);
441 
442  if (pParameter) return pParameter->getType();
443 
445 }
const CCopasiParameter::Type & getType() const
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameter::Type CCopasiParameterGroup::getType ( const size_t &  index) const

Retrieve the type of a parameter or subgroup

Parameters
constsize_t & index
Returns
CCopasiParameter::Type

Definition at line 447 of file CCopasiParameterGroup.cpp.

References getParameter(), CCopasiParameter::getType(), and CCopasiParameter::INVALID.

448 {
449  CCopasiParameter * pParameter =
450  const_cast< CCopasiParameterGroup * >(this)->getParameter(index);
451 
452  if (pParameter) return pParameter->getType();
453 
455 }
const CCopasiParameter::Type & getType() const
CCopasiParameter * getParameter(const std::string &name)
std::string CCopasiParameterGroup::getUniqueParameterName ( const CCopasiParameter pParameter) const

Retrieve a unique name for the given parameter

Parameters
constCCopasiParameter * pParameter
Returns
std::string uniqueParameterName

Definition at line 539 of file CCopasiParameterGroup.cpp.

References C_INVALID_INDEX, CCopasiObject::getObjectName(), CCopasiParameter::mValue, and CCopasiParameter::Value::pGROUP.

Referenced by CCopasiParameter::getCN(), and CCopasiParameter::getObjectDisplayName().

540 {
541  size_t counter = C_INVALID_INDEX;
542  size_t Index = C_INVALID_INDEX;
543 
544  std::string Name = pParameter->getObjectName();
545 
546  index_iterator it = mValue.pGROUP->begin();
547  index_iterator end = mValue.pGROUP->end();
548 
549  for (; it != end; ++it)
550  {
551  if ((*it)->getObjectName() == Name)
552  {
553  counter++;
554 
555  if (*it == pParameter)
556  {
557  Index = counter;
558  }
559  }
560  }
561 
562  if (counter == 0 || Index == C_INVALID_INDEX)
563  {
564  return Name;
565  }
566 
567  std::stringstream UniqueName;
568  UniqueName << Name << "[" << Index << "]";
569 
570  return UniqueName.str();
571 }
const std::string & getObjectName() const
std::vector< CCopasiParameter * > * pGROUP
#define C_INVALID_INDEX
Definition: copasi.h:222
parameterGroup::iterator index_iterator
const CCopasiParameter::Value & CCopasiParameterGroup::getValue ( const std::string &  name) const

Retrieve a pointer to the value of a parameter or subgroup

Parameters
conststd::string & name
Returns
const CCopasiParameter::Value & Value

Definition at line 395 of file CCopasiParameterGroup.cpp.

References fatalError, getParameter(), and CCopasiParameter::getValue().

Referenced by CFitItem::addCrossValidation(), CFitItem::addExperiment(), CSensProblem::copyParameterGroupToSensItem(), CScanItem::createScanItemFromParameterGroup(), CScanItem::CScanItem(), CScanItemLinear::CScanItemLinear(), CScanItemRandom::CScanItemRandom(), CFitProblem::elevateChildren(), CExperiment::elevateChildren(), CFitItem::getCrossValidation(), CFitItem::getCrossValidations(), CFitItem::getExperiment(), CFitItem::getExperiments(), getParameterValue(), CReaction::getParameterValue(), CScanTask::initSubtask(), CScanWidgetRepeat::load(), CScanWidgetRandom::load(), CScanWidgetScan::load(), Curve2DWidget::LoadFromCurveSpec(), HistoWidget::LoadFromCurveSpec(), BandedGraphWidget::LoadFromCurveSpec(), ScanWidget::loadTask(), operator==(), CCopasiXML::saveModel(), Curve2DWidget::SaveToCurveSpec(), HistoWidget::SaveToCurveSpec(), CopasiUI3Window::slotOpenRecentFile(), and CopasiUI3Window::slotOpenRecentSBMLFile().

396 {
397  CCopasiParameter * pParameter =
398  const_cast< CCopasiParameterGroup * >(this)->getParameter(name);
399 
400  if (!pParameter)
401  fatalError();
402 
403  return pParameter->getValue();
404 }
#define fatalError()
const Value & getValue() const
CCopasiParameter * getParameter(const std::string &name)
const CCopasiParameter::Value & CCopasiParameterGroup::getValue ( const size_t &  index) const

Retrieve a pointer to the value of a parameter or subgroup

Parameters
constsize_t & index
Returns
const CCopasiParameter::Value & Value

Definition at line 406 of file CCopasiParameterGroup.cpp.

References fatalError, getParameter(), and CCopasiParameter::getValue().

407 {
408  CCopasiParameter * pParameter =
409  const_cast< CCopasiParameterGroup * >(this)->getParameter(index);
410 
411  if (!pParameter)
412  fatalError();
413 
414  return pParameter->getValue();
415 }
#define fatalError()
const Value & getValue() const
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameter::Value & CCopasiParameterGroup::getValue ( const std::string &  name)

Retrieve a pointer to the value of a parameter or subgroup

Parameters
conststd::string & name
Returns
CCopasiParameter::Value & Value

Definition at line 417 of file CCopasiParameterGroup.cpp.

References fatalError, getParameter(), and CCopasiParameter::getValue().

418 {
419  CCopasiParameter * pParameter = getParameter(name);
420 
421  if (!pParameter)
422  fatalError();
423 
424  return pParameter->getValue();
425 }
#define fatalError()
const Value & getValue() const
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameter::Value & CCopasiParameterGroup::getValue ( const size_t &  index)

Retrieve a pointer to the value of a parameter or subgroup

Parameters
constsize_t & index
Returns
CCopasiParameter::Value & Value

Definition at line 427 of file CCopasiParameterGroup.cpp.

References fatalError, getParameter(), and CCopasiParameter::getValue().

428 {
429  CCopasiParameter * pParameter = getParameter(index);
430 
431  if (!pParameter)
432  fatalError();
433 
434  return pParameter->getValue();
435 }
#define fatalError()
const Value & getValue() const
CCopasiParameter * getParameter(const std::string &name)
CCopasiParameterGroup & CCopasiParameterGroup::operator= ( const CCopasiParameterGroup rhs)

Assignment operator

Parameters
constCCopasiParameterGroup & rhs
Returns
CCopasiParameterGroup & lhs

Definition at line 92 of file CCopasiParameterGroup.cpp.

References addParameter(), beginName(), CCopasiParameter::CCopasiParameter(), CCopasiParameterGroup(), endName(), CCopasiObject::getObjectName(), CCopasiParameter::GROUP, removeParameter(), and CCopasiObject::setObjectName().

93 {
94  if (getObjectName() != rhs.getObjectName())
96 
97  name_iterator itRHS = rhs.beginName();
98  name_iterator endRHS = rhs.endName();
99 
100  name_iterator itLHS = beginName();
101  name_iterator endLHS = endName();
102 
103  std::vector< std::string > ToBeRemoved;
104  std::vector< CCopasiParameter * > ToBeAdded;
105 
106  CCopasiParameter * pLHS;
107  CCopasiParameter * pRHS;
108 
109  while (itRHS != endRHS && itLHS != endLHS)
110  {
111  // We only assign parameters
112  if ((pRHS = dynamic_cast< CCopasiParameter * >(itRHS->second)) == NULL)
113  {
114  ++itRHS;
115  continue;
116  }
117 
118  // We only assign parameters
119  if ((pLHS = dynamic_cast< CCopasiParameter * >(itLHS->second)) == NULL)
120  {
121  ++itLHS;
122  continue;
123  }
124 
125  const std::string & NameLHS = pLHS->getObjectName();
126 
127  const std::string & NameRHS = pRHS->getObjectName();
128 
129  // The LHS parameter is missing on the RHS thus we need to remove it
130  if (NameLHS < NameRHS)
131  {
132  ToBeRemoved.push_back(NameLHS);
133  ++itLHS;
134  continue;
135  }
136 
137  // The RHS parameter is missing on the LHS thus we need to add it
138  if (NameLHS > NameRHS)
139  {
140  ToBeAdded.push_back(pRHS);
141  ++itRHS;
142  continue;
143  }
144 
145  // The names are equal it suffices to use the assignment operator of the parameter
146  *pLHS = *pRHS;
147  ++itLHS;
148  ++itRHS;
149  }
150 
151  // All remaining parameters of the LHS need to be removed
152  while (itLHS != endLHS)
153  {
154  // We only assign parameters
155  if ((pLHS = dynamic_cast< CCopasiParameter * >(itLHS->second)) != NULL)
156  ToBeRemoved.push_back(pLHS->getObjectName());
157 
158  ++itLHS;
159  }
160 
161  // All remaining paramter of the RHS need to be added
162  while (itRHS != endRHS)
163  {
164  // We only assign parameters
165  if ((pRHS = dynamic_cast< CCopasiParameter * >(itRHS->second)) != NULL)
166  ToBeAdded.push_back(pRHS);
167 
168  ++itRHS;
169  }
170 
171  // We remove the parameters
172  std::vector< std::string >::const_iterator itToBeRemoved = ToBeRemoved.begin();
173  std::vector< std::string >::const_iterator endToBeRemoved = ToBeRemoved.end();
174 
175  for (; itToBeRemoved != endToBeRemoved; ++itToBeRemoved)
176  this->removeParameter(*itToBeRemoved);
177 
178  // We add the missing parameters
179  CCopasiParameter * pParameter;
180  std::vector< CCopasiParameter * >::const_iterator itToBeAdded = ToBeAdded.begin();
181  std::vector< CCopasiParameter * >::const_iterator endToBeAdded = ToBeAdded.end();
182 
183  for (; itToBeAdded != endToBeAdded; ++itToBeAdded)
184  {
185  if ((*itToBeAdded)->getType() == GROUP)
186  pParameter = new CCopasiParameterGroup(* static_cast< CCopasiParameterGroup * >(*itToBeAdded));
187  else
188  pParameter = new CCopasiParameter(**itToBeAdded);
189 
190  addParameter(pParameter);
191  }
192 
193  return *this;
194 }
const std::string & getObjectName() const
name_iterator beginName() const
CCopasiContainer::objectMap::iterator name_iterator
bool removeParameter(const std::string &name)
bool addParameter(const CCopasiParameter &parameter)
name_iterator endName() const
bool setObjectName(const std::string &name)
void CCopasiParameterGroup::print ( std::ostream *  ostream) const
virtual

This is the output method for any object. The default implementation provided with CCopasiObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.

Parameters
std::ostream* ostream

Reimplemented from CCopasiParameter.

Reimplemented in COptProblem, CCopasiMethod, CCopasiProblem, CSensProblem, CCrossSectionProblem, CLNAProblem, CMCAProblem, CFitProblem, and COscillationProblem.

Definition at line 196 of file CCopasiParameterGroup.cpp.

Referenced by operator<<().

197 {*ostream << *this;}
bool CCopasiParameterGroup::removeParameter ( const std::string &  name)

Remove a parameter or subgroup from the group

Parameters
conststd::string & name
Returns
bool success

Definition at line 309 of file CCopasiParameterGroup.cpp.

References C_INVALID_INDEX, getIndex(), CCopasiParameter::mValue, pdelete, and CCopasiParameter::Value::pGROUP.

Referenced by assertGroup(), assertParameter(), COptMethodSS::elevateChildren(), CFitProblem::elevateChildren(), CFitItem::elevateChildren(), COptProblem::elevateChildren(), CTSSAProblem::elevateChildren(), CExperiment::elevateChildren(), CTSSAMethod::initializeIntegrationsParameter(), CSteadyStateMethod::initializeParameter(), CNewtonMethod::initializeParameter(), CMCAMethod::initializeParameter(), CHybridMethodODE45::initializeParameter(), CTauLeapMethod::initializeParameter(), CLyapWolfMethod::initializeParameter(), CStochMethod::initializeParameter(), CFitProblem::initializeParameter(), CLsodaMethod::initializeParameter(), CTrajectoryMethodDsaLsodar::initializeParameter(), CHybridMethod::initializeParameter(), CHybridMethodLSODA::initializeParameter(), CExperiment::initializeParameter(), CReaction::initializeParameters(), COptMethodLevenbergMarquardt::initObjects(), operator=(), CFitItem::removeCrossValidation(), CExperimentSet::removeExperiment(), CFitItem::removeExperiment(), COptProblem::removeOptItem(), CScanProblem::removeScanItem(), CSensProblem::removeVariables(), CQFittingItemWidget::save(), CExperimentObjectMap::CDataColumn::setObjectCN(), CExperimentObjectMap::CDataColumn::setScale(), and CQExperimentData::slotOK().

310 {
311  size_t index = getIndex(name);
312 
313  if (index != C_INVALID_INDEX)
314  {
315  index_iterator it =
316  mValue.pGROUP->begin() + index;
317 
318  pdelete(*it);
319  mValue.pGROUP->erase(it, it + 1);
320 
321  return true;
322  }
323 
324  return false;
325 }
#define pdelete(p)
Definition: copasi.h:215
size_t getIndex(const std::string &name) const
std::vector< CCopasiParameter * > * pGROUP
#define C_INVALID_INDEX
Definition: copasi.h:222
parameterGroup::iterator index_iterator
bool CCopasiParameterGroup::removeParameter ( const size_t &  index)

Remove a parameter or subgroup from the group

Parameters
constsize_t & index
Returns
bool success

Definition at line 327 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::mValue, pdelete, CCopasiParameter::Value::pGROUP, and size().

328 {
329  if (index < size())
330  {
331  index_iterator it =
332  mValue.pGROUP->begin() + index;
333 
334  pdelete(*it);
335  mValue.pGROUP->erase(it, it + 1);
336 
337  return true;
338  }
339 
340  return false;
341 }
#define pdelete(p)
Definition: copasi.h:215
std::vector< CCopasiParameter * > * pGROUP
parameterGroup::iterator index_iterator
template<class CType >
bool CCopasiParameterGroup::setValue ( const std::string &  name,
const CType &  value 
)
inline

Set the value of a parameter or subgroup.

Parameters
conststd::string & name
constCType & value
Returns
bool success

Definition at line 361 of file CCopasiParameterGroup.h.

References getParameter(), and CCopasiParameter::setValue().

Referenced by CQPlotSubwidget::addHisto1DTab(), CSensProblem::copySensItemToParameterGroup(), COutputAssistant::createDefaultOutput(), COutputAssistant::createPlot(), CFitProblem::elevateChildren(), CCopasiXMLParser::TaskElement::end(), COptMethodDE::initialize(), COptMethodSRES::initialize(), COptMethodPS::initialize(), COptMethodGASR::initialize(), COptMethodSS::initialize(), CTSSAMethod::initializeIntegrationsParameter(), CSteadyStateMethod::initializeParameter(), CNewtonMethod::initializeParameter(), CMCAMethod::initializeParameter(), CHybridMethodODE45::initializeParameter(), CTauLeapMethod::initializeParameter(), CLyapWolfMethod::initializeParameter(), CStochMethod::initializeParameter(), CTrajectoryMethodDsaLsodar::initializeParameter(), CHybridMethod::initializeParameter(), CHybridMethodLSODA::initializeParameter(), CHybridMethodODE45::initMethod(), CHybridMethodLSODA::initMethod(), CSteadyStateProblem::load(), CNewtonMethod::load(), CExperiment::operator=(), COptMethodSS::optimise(), SEDMLImporter::readListOfPlotsFromSedMLOutput(), CScanWidgetRepeat::save(), CScanWidgetRandom::save(), CScanWidgetScan::save(), Curve2DWidget::SaveToCurveSpec(), HistoWidget::SaveToCurveSpec(), CScanProblem::setContinueFromCurrentState(), CSteadyStateProblem::setJacobianRequested(), CPlotSpecification::setLogX(), CPlotSpecification::setLogY(), CScanProblem::setOutputInSubtask(), setParameterValue(), CReaction::setParameterValue(), CSteadyStateProblem::setStabilityAnalysisRequested(), CLNAProblem::setSteadyStateRequested(), CMCAProblem::setSteadyStateRequested(), CScanProblem::setSubtask(), and TestOptimization().

363  {
364  CCopasiParameter * pParameter =
365  const_cast< CCopasiParameterGroup * >(this)->getParameter(name);
366 
367  if (pParameter) return pParameter->setValue(value);
368 
369  return false;
370  }
bool setValue(const CType &value)
CCopasiParameter * getParameter(const std::string &name)
template<class CType >
bool CCopasiParameterGroup::setValue ( const size_t &  index,
const CType &  value 
)
inline

Set the value of a parameter or subgroup.

Parameters
constsize_t & index
constCType & value
Returns
bool success

Definition at line 379 of file CCopasiParameterGroup.h.

References getParameter(), and CCopasiParameter::setValue().

381  {
382  CCopasiParameter * pParameter =
383  const_cast< CCopasiParameterGroup * >(this)->getParameter(index);
384 
385  if (pParameter) return pParameter->setValue(value);
386 
387  return false;
388  }
bool setValue(const CType &value)
CCopasiParameter * getParameter(const std::string &name)
size_t CCopasiParameterGroup::size ( ) const

The size of the parameter group @ return size_t size

Definition at line 512 of file CCopasiParameterGroup.cpp.

References CCopasiParameter::mValue, and CCopasiParameter::Value::pGROUP.

Referenced by CFitItem::addCrossValidation(), CFitItem::addExperiment(), CRecentFiles::addFile(), DataModelGUI::buildChangedObjects(), CModel::buildInitialRefreshSequence(), CModel::buildInitialSequence(), CQTaskMethodWidget::changeMethod(), CModelAnalyzer::checkReaction(), CExperimentObjectMap::compile(), CExperiment::elevateChildren(), CODEExporter::exportReacParamsAndFuncs(), CODEExporterC::exportTitleData(), CFitItem::getCrossValidation(), CFitItem::getCrossValidationCount(), CFitItem::getCrossValidations(), CFitItem::getExperiment(), CExperimentSet::getExperimentCount(), CFitItem::getExperimentCount(), CFitItem::getExperiments(), CMIRIAMResources::getMIRIAMResource(), CScanProblem::getNumberOfScanItems(), CSensProblem::getNumberOfVariables(), COptProblem::getOptItemSize(), getParameter(), getParameterValue(), CReaction::isLocalParameter(), CExperimentSet::keyToIndex(), CQFittingItemWidget::load(), CConfigurationFile::load(), CQTaskMethodWidget::loadMethod(), CQLNAWidget::loadParameterTable(), CQMCAWidget::loadParameterTable(), operator<<(), CQSimpleSelectionTree::populateTree(), CCSPMethod::printResult(), CExperiment::read(), removeParameter(), CSensProblem::removeVariables(), CQFittingItemWidget::save(), CQTaskMethodWidget::saveMethod(), CCopasiXML::saveModel(), CQLNAWidget::saveParameterTable(), CQMCAWidget::saveParameterTable(), setParameterValue(), CQEFMReactionDM::setTask(), CQFittingItemWidget::slotReset(), CExperiment::updateFittedPoints(), and CQMiriamWidget::updateResourcesList().

513 {return mValue.pGROUP->size();}
std::vector< CCopasiParameter * > * pGROUP
bool CCopasiParameterGroup::swap ( const size_t &  iFrom,
const size_t &  iTo 
)

Swap two parameters Note: This has effect on the index_iterator and index access methods.

Parameters
constsize_t & iFrom
constsize_t & iTo
Returns
bool success

Definition at line 489 of file CCopasiParameterGroup.cpp.

References beginIndex().

Referenced by CExperimentSet::sort(), and COptProblem::swapOptItem().

491 {
492  index_iterator from = beginIndex() + iFrom;
493  index_iterator to = beginIndex() + iTo;
494 
495  return swap(from, to);
496 }
bool swap(const size_t &iFrom, const size_t &iTo)
index_iterator beginIndex() const
parameterGroup::iterator index_iterator
bool CCopasiParameterGroup::swap ( index_iterator from,
index_iterator to 
)

Swap two parameters Note: This has effect on the iterator and index access methods.

Parameters
index_iterator& from
index_iterator& to
Returns
bool success

Definition at line 498 of file CCopasiParameterGroup.cpp.

References beginIndex(), and endIndex().

500 {
501  if (from < beginIndex() || endIndex() <= from ||
502  to < beginIndex() || endIndex() <= to)
503  return false;
504 
505  CCopasiParameter *tmp = *from;
506  *from = *to;
507  *to = tmp;
508 
509  return true;
510 }
index_iterator endIndex() const
index_iterator beginIndex() const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CCopasiParameterGroup o 
)
friend

Output stream operator

Parameters
ostream& os
constCCopasiParameterGroup & o
Returns
ostream & os

Definition at line 199 of file CCopasiParameterGroup.cpp.

200 {
201  os << "<<< Parameter Group: " << o.getObjectName() << std::endl;
202 
203  CCopasiParameterGroup::parameterGroup::const_iterator it =
204  o.CCopasiParameter::getValue().pGROUP->begin();
205  CCopasiParameterGroup::parameterGroup::const_iterator end =
206  o.CCopasiParameter::getValue().pGROUP->end();
207 
208  for (; it != end; ++it)
209  {
210  (*it)->print(&os);
211  os << std::endl;
212  }
213 
214  os << ">>> Parameter Group: " << o.getObjectName() << std::endl;
215  return os;
216 }
const std::string & getObjectName() const
virtual void print(std::ostream *ostream) const
bool operator== ( const CCopasiParameterGroup lhs,
const CCopasiParameterGroup rhs 
)
friend

Comparison operator

Parameters
constCCopasiParameterGroup & lhs
constCCopasiParameterGroup & rhs
Returns
bool equal

Definition at line 218 of file CCopasiParameterGroup.cpp.

220 {
221  if (lhs.getObjectName() != rhs.getObjectName()) return false;
222 
223  if (lhs.mValue.pGROUP->size() != rhs.mValue.pGROUP->size()) return false;
224 
225  CCopasiParameterGroup::parameterGroup::const_iterator itLhs =
226  lhs.mValue.pGROUP->begin();
227  CCopasiParameterGroup::parameterGroup::const_iterator endLhs =
228  lhs.mValue.pGROUP->end();
229 
230  CCopasiParameterGroup::parameterGroup::const_iterator itRhs =
231  rhs.mValue.pGROUP->begin();
232 
233  for (; itLhs != endLhs; ++itLhs, ++itRhs)
234  if (!(**itLhs == **itRhs)) return false;
235 
236  return true;
237 }
const std::string & getObjectName() const
std::vector< CCopasiParameter * > * pGROUP

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