COPASI API  4.40.278
CExperiment Class Reference

#include <CExperiment.h>

Inheritance diagram for CExperiment:
[legend]

Public Types

enum  Type { ignore = 0 , independent , dependent , time }
 
enum  WeightMethod { MEAN = 0 , MEAN_SQUARE , SD , VALUE_SCALING }
 
- Public Types inherited from CCopasiParameterGroup
typedef CDataObjectMap::const_type_iterator< CCopasiParameterconst_name_iterator
 
typedef std::vector< CCopasiParameter * > elements
 
typedef elements::iterator index_iterator
 
typedef CDataObjectMap::type_iterator< CCopasiParametername_iterator
 
- Public Types inherited from CCopasiParameter
enum class  eUserInterfaceFlag { editable , basic , unsupported , __SIZE }
 
enum class  Type {
  DOUBLE = 0 , UDOUBLE , INT , UINT ,
  BOOL , GROUP , STRING , CN ,
  KEY , FILE , EXPRESSION , INVALID ,
  __SIZE
}
 
typedef CFlags< eUserInterfaceFlagUserInterfaceFlag
 
- Public Types inherited from CDataContainer
typedef CDataObjectMap objectMap
 
- Public Types inherited from CDataObject
typedef std::set< const CDataObject * > DataObjectSet
 
enum  Flag {
  Container , Vector , Matrix , NameVector ,
  Reference , ValueBool , ValueInt , ValueInt64 ,
  ValueDbl , NonUniqueName , StaticString , ValueString ,
  Separator , DisplayName , ModelEntity , Array ,
  DataModel , Root , Gui , __SIZE
}
 
- Public Types inherited from CObjectInterface
typedef std::vector< const CDataContainer * > ContainerList
 
typedef std::set< const CObjectInterface * > ObjectSet
 

Public Member Functions

bool calculateStatistics ()
 
bool calculateWeights ()
 
 CExperiment (const CCopasiParameterGroup &group, const CDataContainer *pParent)
 
 CExperiment (const CDataContainer *pParent, const std::string &name="Experiment")
 
 CExperiment (const CExperiment &src, const CDataContainer *pParent)
 
bool compile (const CMathContainer *pMathContainer)
 
virtual bool elevateChildren ()
 
size_t extendedTimeSeriesSize () const
 
void fixBuild55 ()
 
const std::vector< std::string > & getColumnNames () const
 
size_t getColumnValidValueCount (const CObjectInterface *pObject) const
 
C_FLOAT64 getDefaultScale (const CObjectInterface *pObject) const
 
const CMatrix< C_FLOAT64 > & getDependentData () const
 
const std::map< const CObjectInterface *, size_t > & getDependentObjectsMap () const
 
const C_FLOAT64getErrorMean () const
 
const C_FLOAT64getErrorMeanSD () const
 
C_FLOAT64 getErrorMeanSD (const CObjectInterface *pObject, const C_FLOAT64 &errorMean) const
 
C_FLOAT64 getErrorSum (const CObjectInterface *pObject) const
 
const CTaskEnum::TaskgetExperimentType () const
 
const std::string & getFileName () const
 
const std::string & getFileNameOnly () const
 
const unsigned C_INT32getFirstRow () const
 
const CDataVector< CFittingPoint > & getFittingPoints () const
 
const unsigned C_INT32getHeaderRow () const
 
const CMatrix< C_FLOAT64 > & getIndependentData () const
 
const CObjectInterface::ObjectSetgetIndependentObjects () const
 
const unsigned C_INT32getLastRow () const
 
bool getNormalizeWeightsPerExperiment () const
 
const unsigned C_INT32getNumColumns () const
 
size_t getNumDataRows () const
 
const C_FLOAT64getObjectiveValue () const
 
C_FLOAT64 getObjectiveValue (const CObjectInterface *pObject) const
 
CExperimentObjectMapgetObjectMap ()
 
const CExperimentObjectMapgetObjectMap () const
 
const C_FLOAT64getRMS () const
 
C_FLOAT64 getRMS (const CObjectInterface *pObject) const
 
const C_FLOAT64getScale (const CObjectInterface *pObject) const
 
const CMatrix< C_FLOAT64 > & getScalingMatrix () const
 
const std::string & getSeparator () const
 
const CVector< C_FLOAT64 > & getTimeData () const
 
size_t getTotalValueCount () const
 
size_t getValidValueCount () const
 
const WeightMethodgetWeightMethod () const
 
size_t guessColumnNumber () const
 
void initExtendedTimeSeries (size_t s)
 
const bool & isRowOriented () const
 
CExperimentoperator= (const CExperiment &rhs)
 
virtual void printResult (std::ostream *ostream) const
 
bool read (std::istream &in, size_t &currentLine)
 
bool readColumnNames ()
 
bool setExperimentType (const CTaskEnum::Task &type)
 
bool setFileName (const std::string &fileName)
 
bool setFirstRow (const unsigned C_INT32 &firstRow)
 
bool setHeaderRow (const unsigned C_INT32 &headerRow)
 
bool setIsRowOriented (const bool &isRowOriented)
 
bool setLastRow (const unsigned C_INT32 &lastRow)
 
void setNormalizeWeightsPerExperiment (bool flag)
 
bool setNumColumns (const unsigned C_INT32 &cols)
 
bool setSeparator (const std::string &seperator)
 
bool setWeightMethod (const WeightMethod &weightMethod)
 
void storeExtendedTimeSeriesData (C_FLOAT64 time)
 
C_FLOAT64 sumOfSquares (const size_t &index, C_FLOAT64 *&residuals) const
 
C_FLOAT64 sumOfSquaresStore (const size_t &index, C_FLOAT64 *&dependentValues)
 
void updateFittedPoints ()
 
void updateFittedPointValues (const size_t &index)
 
void updateFittedPointValuesFromExtendedTimeSeries (const size_t &index)
 
bool updateModelWithIndependentData (const size_t &index)
 
virtual ~CExperiment ()
 
- Public Member Functions inherited from CCopasiParameterGroup
bool addGroup (const std::string &name)
 
void addParameter (CCopasiParameter *pParameter)
 
bool addParameter (const CCopasiParameter &parameter)
 
bool addParameter (const std::string &name, const CCopasiParameter::Type type, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
template<class CType >
bool addParameter (const std::string &name, const CCopasiParameter::Type type, const CType &value, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes)
 
CCopasiParameterGroupassertGroup (const std::string &name, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
template<class CType >
CType * assertParameter (const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue, const CCopasiParameter::UserInterfaceFlag &flag=CCopasiParameter::UserInterfaceFlag::All)
 
index_iterator beginIndex () const
 
const_name_iterator beginName () const
 
 CCopasiParameterGroup (const CCopasiParameterGroup &src, const CDataContainer *pParent=NULL)
 
 CCopasiParameterGroup (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &objectType="ParameterGroup")
 
void clear ()
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const
 
index_iterator endIndex () const
 
const_name_iterator endName () const
 
CCopasiParameterGroupgetElementTemplates ()
 
const CCopasiParameterGroupgetElementTemplates () const
 
CCopasiParameterGroupgetGroup (const size_t &index)
 
const CCopasiParameterGroupgetGroup (const size_t &index) const
 
CCopasiParameterGroupgetGroup (const std::string &name)
 
const CCopasiParameterGroupgetGroup (const std::string &name) const
 
virtual size_t getIndex (const CDataObject *pObject) const
 
size_t getIndex (const std::string &name) const
 
std::string getKey (const size_t &index) const
 
std::string getKey (const std::string &name) const
 
virtual const std::string & getName (const size_t &index) const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const
 
CCopasiParametergetParameter (const size_t &index)
 
const CCopasiParametergetParameter (const size_t &index) const
 
CCopasiParametergetParameter (std::string name)
 
const CCopasiParametergetParameter (std::string name) const
 
CCopasiParameter::Type getType (const size_t &index) const
 
CCopasiParameter::Type getType (const std::string &name) const
 
std::string getUniqueParameterName (const CCopasiParameter *pParameter) const
 
template<class CType >
CType & getValue (const size_t &index)
 
template<class CType >
const CType & getValue (const size_t &index) const
 
template<class CType >
CType & getValue (const std::string &name)
 
template<class CType >
const CType & getValue (const std::string &name) const
 
bool haveTemplate () const
 
virtual CUndoObjectInterfaceinsert (const CData &data)
 
CCopasiParameterGroupoperator= (const CCopasiParameterGroup &rhs)
 
virtual void print (std::ostream *ostream) const
 
virtual bool remove (CDataObject *pObject)
 
bool removeParameter (CCopasiParameter *pParameter)
 
bool removeParameter (const size_t &index)
 
bool removeParameter (const std::string &name)
 
virtual void setUserInterfaceFlag (const UserInterfaceFlag &flag)
 
template<class CType >
bool setValue (const size_t &index, const CType &value)
 
template<class CType >
bool setValue (const std::string &name, const CType &value)
 
size_t size (const UserInterfaceFlag &require=UserInterfaceFlag::None, const UserInterfaceFlag &exclude=UserInterfaceFlag::None) const
 
bool swap (const size_t &iFrom, const size_t &iTo)
 
bool swap (index_iterator &from, index_iterator &to)
 
virtual CData toData () const
 
virtual void updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject)
 
virtual ~CCopasiParameterGroup ()
 
- Public Member Functions inherited from CCopasiParameter
 CCopasiParameter (const CCopasiParameter &src, const CDataContainer *pParent)
 
 CCopasiParameter (const std::string &name, const Type &type, const void *pValue=NULL, const CDataContainer *pParent=NO_PARENT, const std::string &objectType="Parameter")
 
virtual CCommonName getCN () const override
 
template<class CType >
const CType & getDefault () const
 
virtual const std::string & getKey () const override
 
virtual std::string getObjectDisplayName () const override
 
const CCopasiParameter::TypegetType () const
 
const UserInterfaceFlaggetUserInterfaceFlag () const
 
template<class CType >
std::vector< std::pair< CType, CType > > & getValidValues ()
 
template<class CType >
const std::vector< std::pair< CType, CType > > & getValidValues () const
 
void * getValidValuesPointer () const
 
template<class CType >
CType & getValue ()
 
template<class CType >
const CType & getValue () const
 
virtual void * getValuePointer () const override
 
CDataObjectgetValueReference () const
 
bool hasValidValues () const
 
bool isBasic () const
 
bool isDefault () const
 
bool isEditable () const
 
bool isUnsupported () const
 
bool isValidValue (const bool &value) const
 
bool isValidValue (const C_FLOAT64 &value) const
 
bool isValidValue (const C_INT32 &value) const
 
bool isValidValue (const CCommonName &value) const
 
template<class CType >
bool isValidValue (const CType &) const
 
bool isValidValue (const std::string &value) const
 
bool isValidValue (const std::vector< CCopasiParameter * > &value) const
 
bool isValidValue (const unsigned C_INT32 &value) const
 
CCopasiParameteroperator= (const CCopasiParameter &rhs)
 
template<class CType >
bool setDefault (const CType &defaultValue)
 
bool setDefault (const std::vector< CCopasiParameter * > &defaultValue)
 
virtual bool setObjectParent (const CDataContainer *pParent) override
 
template<class CType , class Enum >
bool setValidValues (const CEnumAnnotation< CType, Enum > &validValues)
 
template<class CType >
bool setValidValues (const std::vector< std::pair< CType, CType > > &validValues)
 
template<class CType >
bool setValue (const CType &value)
 
bool setValue (const std::vector< CCopasiParameter * > &value)
 
virtual ~CCopasiParameter ()
 
- Public Member Functions inherited from CDataContainer
virtual bool add (CDataObject *pObject, const bool &adopt=true)
 
virtual bool appendDeletedDependentData (CUndoData &undoData) const
 
 CDataContainer (const CDataContainer &src, const CDataContainer *pParent)
 
 CDataContainer (const std::string &name, const CDataContainer *pParent=NO_PARENT, const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
virtual std::string getChildObjectUnits (const CDataObject *pObject) const
 
void getDescendants (CDataObject::DataObjectSet &descendants, const bool &recursive=false) const
 
virtual objectMapgetObjects ()
 
virtual const objectMapgetObjects () const
 
virtual const std::string getUnits () const override
 
virtual const CDataObjectgetValueObject () const override
 
void objectRenamed (CDataObject *pObject, const std::string &oldName)
 
virtual ~CDataContainer ()
 
- Public Member Functions inherited from CDataObject
void addIssue (const CIssue &issue)
 
void addReference (const CDataContainer *pReference)
 
virtual void calculateValue () override
 
 CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL)
 
virtual void destruct () override
 
virtual const CDataObjectgetDataObject () const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const CValiditygetValidity () const override
 
bool hasFlag (const Flag &flag) const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override
 
bool prerequisitsContains (const DataObjectSet &objects) const
 
void removeIssue (const CIssue &issue)
 
void removeReference (const CDataContainer *pReference)
 
bool setObjectName (const std::string &name)
 
void validityChanged (const CValidity &changedValidity) override
 
void validityRemoved (const CValidity &changedValidity)
 
virtual ~CDataObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
 CObjectInterface (const CObjectInterface &src)
 
virtual ~CObjectInterface ()
 
- Public Member Functions inherited from CUndoObjectInterface
 CUndoObjectInterface ()
 
 CUndoObjectInterface (const CUndoObjectInterface &src)
 
bool generateUuid ()
 
const xg::Guid & getUuid () const
 
bool setUuid (const std::string &uuid)
 
bool setUuid (const xg::Guid &uuid)
 
virtual ~CUndoObjectInterface ()
 

Static Public Member Functions

static bool compare (const CExperiment *lhs, const CExperiment *rhs)
 
- Static Public Member Functions inherited from CCopasiParameter
static void allocateValidValues (const Type &type, void *&pValidValues)
 
static void allocateValue (const Type &type, void *&pValue)
 
static void assignValue (const Type &type, void *&pValue, const void *pNewValue)
 
static void deleteValidValues (const Type &type, void *&pValidValues)
 
static void deleteValue (const Type &type, void *&pValue)
 
static CCopasiParameterfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataContainer
static CDataContainerfromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName)
 
- Static Public Member Functions inherited from CUndoObjectInterface
template<class CType >
static CType * fromData (const CData &, CUndoObjectInterface *)
 

Static Public Attributes

static const std::string TypeName []
 
static const std::string WeightMethodName []
 
static const char * WeightMethodType []
 
static const char * XMLType []
 
- Static Public Attributes inherited from CCopasiParameter
static const CEnumAnnotation< std::string, TypeTypeName
 
static const CEnumAnnotation< std::string, TypeXMLType
 
- Static Public Attributes inherited from CDataContainer
static const CObjectInterface::ContainerList EmptyList
 

Protected Member Functions

 CExperiment (const CExperiment &src)
 
- Protected Member Functions inherited from CCopasiParameterGroup
 CCopasiParameterGroup ()
 
- Protected Member Functions inherited from CCopasiParameter
 CCopasiParameter (const CCopasiParameter &src)
 
- Protected Member Functions inherited from CDataContainer
template<class CType >
CDataMatrixReference< CType > * addMatrixReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataObjectReference< CType > * addObjectReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
template<class CType >
CDataVectorReference< CType > * addVectorReference (const std::string &name, CType &reference, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
 CDataContainer (const CDataContainer &src)
 
void initObjects ()
 
- Protected Member Functions inherited from CDataObject
 CDataObject ()
 
 CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 

Private Member Functions

void initializeParameter ()
 
void initializeScalingMatrix ()
 

Private Attributes

std::vector< std::string > mColumnName
 
CVector< C_FLOAT64mColumnObjectiveValue
 
CVector< C_FLOAT64mColumnRMS
 
CVector< C_FLOAT64mColumnScale
 
CVector< size_t > mColumnValidValueCount
 
CMatrix< C_FLOAT64mDataDependent
 
CMatrix< C_FLOAT64mDataIndependent
 
CVector< C_FLOAT64mDataTime
 
CVector< C_FLOAT64mDefaultColumnScale
 
std::map< const CObjectInterface *, size_t > mDependentObjectsMap
 
CCore::CUpdateSequence mDependentUpdateSequence
 
CVector< C_FLOAT64 * > mDependentValues
 
CVector< C_FLOAT64mExtendedTimeSeries
 
size_t mExtendedTimeSeriesSize
 
CDataVector< CFittingPointmFittingPoints
 
CObjectInterface::ObjectSet mIndependentObjects
 
CCore::CUpdateSequence mIndependentUpdateSequence
 
CVector< C_FLOAT64 * > mIndependentValues
 
C_FLOAT64 mMean
 
CVector< C_FLOAT64mMeans
 
C_FLOAT64 mMeanSD
 
bool mMissingData
 
size_t mNumDataRows
 
C_FLOAT64 mObjectiveValue
 
CMathContainermpContainer
 
C_FLOAT64mpDataDependentCalculated
 
std::string * mpFileName
 
unsigned C_INT32mpFirstRow
 
unsigned C_INT32mpHeaderRow
 
unsigned C_INT32mpLastRow
 
bool * mpNormalizeWeightsPerExperiment
 
unsigned C_INT32mpNumColumns
 
CExperimentObjectMapmpObjectMap
 
bool * mpRowOriented
 
std::string * mpSeparator
 
CTaskEnum::TaskmpTaskType
 
WeightMethodmpWeightMethod
 
C_FLOAT64 mRMS
 
CVector< C_FLOAT64mRowObjectiveValue
 
CVector< C_FLOAT64mRowRMS
 
CMatrix< C_FLOAT64mScale
 
C_FLOAT64mStorageIt
 
size_t mValidValueCount
 

Friends

bool operator== (const CExperiment &lhs, const CExperiment &rhs)
 

Additional Inherited Members

- Protected Attributes inherited from CCopasiParameter
std::string mKey
 
void * mpDefault
 
void * mpValidValues
 
void * mpValue
 
CDataObjectmpValueReference
 
UserInterfaceFlag mUserInterfaceFlag
 
- Protected Attributes inherited from CDataContainer
objectMap mObjects
 
- Protected Attributes inherited from CDataObject
ObjectSet mPrerequisits
 
std::set< CDataContainer * > mReferences
 
- Protected Attributes inherited from CObjectInterface
CValidity mValidity
 

Member Enumeration Documentation

◆ Type

Enumeration of the types of columns known to COPASI.

Enumerator
ignore 
independent 
dependent 
time 

◆ WeightMethod

Enumeration of methods to calculate the weight.

Enumerator
MEAN 
MEAN_SQUARE 
SD 
VALUE_SCALING 

Constructor & Destructor Documentation

◆ CExperiment() [1/4]

CExperiment::CExperiment ( const CExperiment src)
protected

◆ CExperiment() [2/4]

CExperiment::CExperiment ( const CDataContainer pParent,
const std::string &  name = "Experiment" 
)

Default constructor

Parameters
constCDataContainer * pParent
conststd::string & name (default: Experiment)

References CVectorCore< CType >::array(), initializeParameter(), mExtendedTimeSeries, and mStorageIt.

◆ CExperiment() [3/4]

CExperiment::CExperiment ( const CExperiment src,
const CDataContainer pParent 
)

Copy constructor

Parameters
constCExperiment & src
constCDataContainer * pParent (default: src data model)

References CVectorCore< CType >::array(), initializeParameter(), mExtendedTimeSeries, and mStorageIt.

◆ CExperiment() [4/4]

CExperiment::CExperiment ( const CCopasiParameterGroup group,
const CDataContainer pParent 
)

Specific constructor used for reading COPASI files

Parameters
constCCopasiParameterGroup & group
constCDataContainer * pParent (default: group data model)

References CVectorCore< CType >::array(), initializeParameter(), mExtendedTimeSeries, and mStorageIt.

◆ ~CExperiment()

CExperiment::~CExperiment ( )
virtual

Destructor

Member Function Documentation

◆ calculateStatistics()

◆ calculateWeights()

bool CExperiment::calculateWeights ( )

◆ compare()

bool CExperiment::compare ( const CExperiment lhs,
const CExperiment rhs 
)
static

Comparison used to evaluate the order of the experiment based on the filename and starting line number.

Parameters
constCExperiment * lhs;
constCExperiment * rhs;
Returns
bool isLess

References mpFileName, and mpFirstRow.

Referenced by CExperimentSet::sort().

◆ compile()

bool CExperiment::compile ( const CMathContainer pMathContainer)

Compile the experiment. This function must be called before any evaluations can be performed.

Parameters
constCMathContainer * pMathContainer
Returns
bool success

References C_FLOAT64, C_INVALID_INDEX, CExperimentObjectMap::compile(), CCore::Default, dependent, CCopasiMessage::ERROR, CMathObject::getDataObject(), CExperimentObjectMap::getDataObjects(), CMathContainer::getInitialDependencies(), CMathContainer::getInitialStateObjects(), CExperimentObjectMap::getLastColumn(), CExperimentObjectMap::getLastNotIgnoredColumn(), CMathContainer::getMathObject(), CDataObject::getObjectDisplayName(), CExperimentObjectMap::getRole(), CExperimentObjectMap::getScale(), CMathContainer::getSimulationUpToDateObjects(), CMathContainer::getStateObjects(), CMathContainer::getTransientDependencies(), CMathDependencyGraph::getUpdateSequence(), CMathObject::getValuePointer(), CDataObject::hasFlag(), ignore, independent, initializeScalingMatrix(), MCFitting, mColumnObjectiveValue, mColumnRMS, mColumnScale, mColumnValidValueCount, mDataDependent, mDataIndependent, mDependentObjectsMap, mDependentUpdateSequence, mDependentValues, mIndependentObjects, mIndependentUpdateSequence, mIndependentValues, mMean, mMeanSD, mObjectiveValue, mpContainer, mpNumColumns, mpObjectMap, mpTaskType, mRMS, mRowObjectiveValue, mRowRMS, CMatrix< CType >::numCols(), CMatrix< CType >::numRows(), pMathContainer, CVector< CType >::resize(), time, CTaskEnum::timeCourse, CCore::UpdateMoieties, and CDataObject::ValueDbl.

Referenced by CModel::createEventsForTimeseries().

◆ elevateChildren()

◆ extendedTimeSeriesSize()

size_t CExperiment::extendedTimeSeriesSize ( ) const

◆ fixBuild55()

void CExperiment::fixBuild55 ( )

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

References CExperimentObjectMap::fixBuild55(), and mpObjectMap.

◆ getColumnNames()

const std::vector< std::string > & CExperiment::getColumnNames ( ) const

Retrieve the column names

Returns
const std::vector< std::string > & columnNames;

References mColumnName.

◆ getColumnValidValueCount()

size_t CExperiment::getColumnValidValueCount ( const CObjectInterface pObject) const

Retrieve the data point count for the object.

Parameters
constCObjectInterface * pObject
Returns
size_t count

References mColumnValidValueCount, and mDependentObjectsMap.

◆ getDefaultScale()

C_FLOAT64 CExperiment::getDefaultScale ( const CObjectInterface pObject) const

Retrieve the default scaling factor for the object.

Parameters
constCObjectInterface * pObject
Returns
C_FLOAT64 defaultScale

References mDefaultColumnScale, and mDependentObjectsMap.

Referenced by CExperimentObjectMap::CDataColumn::getDefaultScale().

◆ getDependentData()

const CMatrix< C_FLOAT64 > & CExperiment::getDependentData ( ) const

Retrieve the dependent data of the experiment.

Returns
const CMatrix< C_FLOAT64 > & dependentData

References mDataDependent.

Referenced by CFitProblem::calculate(), CModel::createEventsForTimeseries(), CExperimentSet::getDependentData(), and initExtendedTimeSeries().

◆ getDependentObjectsMap()

const std::map< const CObjectInterface *, size_t > & CExperiment::getDependentObjectsMap ( ) const

Retrieve the mapping of dependent data objects to the index of the column, only counting columns with dependent data

Returns
const std::map< const CDataObject *, size_t > & dependentObjects

References mDependentObjectsMap.

Referenced by CFitProblem::calculate(), CFitProblem::calculateStatistics(), and CModel::createEventsForTimeseries().

◆ getErrorMean()

const C_FLOAT64 & CExperiment::getErrorMean ( ) const

Retrieve the mean of the error

Parameters
constC_FLOAT64 & errorMean

References mMean.

◆ getErrorMeanSD() [1/2]

const C_FLOAT64 & CExperiment::getErrorMeanSD ( ) const

Retrieve the std. deviation of the error

Parameters
constC_FLOAT64 & errorMeanSD

References mMeanSD.

◆ getErrorMeanSD() [2/2]

C_FLOAT64 CExperiment::getErrorMeanSD ( const CObjectInterface pObject,
const C_FLOAT64 errorMean 
) const

Retrieve the error mean std. deviations for the object. More specifically this is the sum of the squared deviations of the residuals from the provided errorMean. The sum is over all data points for the object.

Parameters
constCObjectInterface * pObject
C_FLOAT64errorMean
Returns
C_FLOAT64 errorMeanSD

References CMatrix< CType >::array(), C_FLOAT64, max, mDataDependent, mDependentObjectsMap, mpDataDependentCalculated, mScale, CMatrix< CType >::numCols(), and CMatrix< CType >::numRows().

◆ getErrorSum()

C_FLOAT64 CExperiment::getErrorSum ( const CObjectInterface pObject) const

Retrieve the sum of errors (scaled residuals) for the object.

Parameters
constCObjectInterface * pObject
Returns
C_FLOAT64 errorSum

References CMatrix< CType >::array(), C_FLOAT64, mColumnScale, mDataDependent, mDependentObjectsMap, mpDataDependentCalculated, CMatrix< CType >::numCols(), and CMatrix< CType >::numRows().

◆ getExperimentType()

const CTaskEnum::Task & CExperiment::getExperimentType ( ) const

◆ getFileName()

const std::string & CExperiment::getFileName ( ) const

◆ getFileNameOnly()

const std::string & CExperiment::getFileNameOnly ( ) const
Returns
returns the fileName only (no changing of paths in case the file is a relative one)

References mpFileName.

Referenced by CDataModel::exportCombineArchive(), CDataModel::exportShinyArchive(), and CDataModel::openCombineArchive().

◆ getFirstRow()

const unsigned C_INT32 & CExperiment::getFirstRow ( ) const

Retrieve the first row

Returns
const unsigned C_INT32 & firstRow

References mpFirstRow.

◆ getFittingPoints()

const CDataVector< CFittingPoint > & CExperiment::getFittingPoints ( ) const

Retrieve the list of fitting points

Returns
const CDataVector< CFittingPoint > & fittingPoints

References mFittingPoints.

Referenced by COutputAssistant::createDefaultOutput().

◆ getHeaderRow()

const unsigned C_INT32 & CExperiment::getHeaderRow ( ) const

Retrieve the header row

Returns
const unsigned C_INT32 & headerRow

References mpHeaderRow.

◆ getIndependentData()

const CMatrix< C_FLOAT64 > & CExperiment::getIndependentData ( ) const

Retrieve the independent data of the experiment.

Returns
const CMatrix< C_FLOAT64 > & independentData

References mDataIndependent.

Referenced by CExperimentSet::getIndependentData().

◆ getIndependentObjects()

const CObjectInterface::ObjectSet & CExperiment::getIndependentObjects ( ) const

Retrieve the list of independent objects

Returns
const CObjectInterface::ObjectSet & independentObjects

References mIndependentObjects.

Referenced by CFitProblem::initialize().

◆ getLastRow()

const unsigned C_INT32 & CExperiment::getLastRow ( ) const

Retrieve the last row

Returns
const unsigned C_INT32 & lastRow

References mpLastRow.

◆ getNormalizeWeightsPerExperiment()

bool CExperiment::getNormalizeWeightsPerExperiment ( ) const

◆ getNumColumns()

const unsigned C_INT32 & CExperiment::getNumColumns ( ) const

Retrieve the number of columns

Returns
const unsigned C_INT32 & numColumns

References mpNumColumns.

◆ getNumDataRows()

size_t CExperiment::getNumDataRows ( ) const

◆ getObjectiveValue() [1/2]

const C_FLOAT64 & CExperiment::getObjectiveValue ( ) const

Retrieve the value of the objective function

Parameters
constC_FLOAT64 & errorMean

References mObjectiveValue.

◆ getObjectiveValue() [2/2]

C_FLOAT64 CExperiment::getObjectiveValue ( const CObjectInterface pObject) const

Retrieve the objective value for the object.

Parameters
constCObjectInterface * pObject
Returns
C_FLOAT64 objectiveValue

References mColumnObjectiveValue, and mDependentObjectsMap.

◆ getObjectMap() [1/2]

CExperimentObjectMap & CExperiment::getObjectMap ( )

Retrieve the object map

Returns
CExperimentObjectMap & mpObjectMap

References mpObjectMap.

◆ getObjectMap() [2/2]

const CExperimentObjectMap & CExperiment::getObjectMap ( ) const

Retrieve the object map

Returns
CExperimentObjectMap & mpObjectMap

References mpObjectMap.

◆ getRMS() [1/2]

const C_FLOAT64 & CExperiment::getRMS ( ) const

Retrieve the RMS

Parameters
constC_FLOAT64 & RMS

References mRMS.

◆ getRMS() [2/2]

C_FLOAT64 CExperiment::getRMS ( const CObjectInterface pObject) const

Retrieve the RMS for the object.

Parameters
constCObjectInterface * pObject
Returns
C_FLOAT64 RMS

References mColumnRMS, and mDependentObjectsMap.

◆ getScale()

const C_FLOAT64 * CExperiment::getScale ( const CObjectInterface pObject) const

Retrieve the scaling factor for the object.

Parameters
constCObjectInterface * pObject
Returns
C_FLOAT64 scale or NULL if object can't be found

References mDependentObjectsMap, and mScale.

◆ getScalingMatrix()

const CMatrix< C_FLOAT64 > & CExperiment::getScalingMatrix ( ) const
Returns
the scaling matrix

References mScale.

Referenced by CFitProblem::calculate().

◆ getSeparator()

const std::string & CExperiment::getSeparator ( ) const

Retrieve the separator

Returns
const std::string & separator

References mpSeparator.

◆ getTimeData()

const CVector< C_FLOAT64 > & CExperiment::getTimeData ( ) const

Retrieve the time data of the experiment.

Returns
const CVector< C_FLOAT64 > & timeData

References mDataTime.

Referenced by CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), and CModel::createEventsForTimeseries().

◆ getTotalValueCount()

size_t CExperiment::getTotalValueCount ( ) const

get number of independent data points expected given the number of rows and columns

References getNumDataRows(), mDataDependent, and CMatrix< CType >::numCols().

◆ getValidValueCount()

size_t CExperiment::getValidValueCount ( ) const

get number of independent data points for the whole experiment only valid data points (that contain actual data) are counted.

References mValidValueCount.

◆ getWeightMethod()

const CExperiment::WeightMethod & CExperiment::getWeightMethod ( ) const

Retrieve the method used for calculating the default weights.

Returns
const WeightMethod & weightMethod

References mpWeightMethod.

◆ guessColumnNumber()

size_t CExperiment::guessColumnNumber ( ) const

Try to guess the number of columns

Returns
size_t numColumns

References CLocaleString::fromUtf8(), getFileName(), CTableRow::guessColumnNumber(), mpFirstRow, mpLastRow, mpSeparator, and skipLine().

◆ initExtendedTimeSeries()

void CExperiment::initExtendedTimeSeries ( size_t  s)

Initialize the storage of an extended time series for plotting. This clears the storage, resizes it to the given size and sets the iterator to the start of the storage. The size given is the number of time points, not the number of data

References CVectorCore< CType >::array(), getDependentData(), mExtendedTimeSeries, mExtendedTimeSeriesSize, mStorageIt, and CVector< CType >::resize().

Referenced by CFitProblem::calculate(), and CFitProblem::calculateCrossValidation().

◆ initializeParameter()

◆ initializeScalingMatrix()

◆ isRowOriented()

const bool & CExperiment::isRowOriented ( ) const

Check whter the data is row oriented.

Returns
const bool & isRowOriented

References mpRowOriented.

Referenced by setIsRowOriented().

◆ operator=()

◆ printResult()

◆ read()

◆ readColumnNames()

bool CExperiment::readColumnNames ( )

◆ setExperimentType()

bool CExperiment::setExperimentType ( const CTaskEnum::Task type)

set the experiment type

Parameters
constCTaskEnum::Task & experimentType
Returns
bool success

References mpTaskType, CTaskEnum::steadyState, and CTaskEnum::timeCourse.

◆ setFileName()

bool CExperiment::setFileName ( const std::string &  fileName)

Set the file name

Parameters
conststd::string & fileName
Returns
bool success

References mpFileName.

Referenced by CDataModel::copyExperimentalDataTo(), CDataModel::exportCombineArchive(), and CDataModel::exportShinyArchive().

◆ setFirstRow()

bool CExperiment::setFirstRow ( const unsigned C_INT32 firstRow)

Set the first row containing data

Parameters
constunsigned C_INT32 & firstRow
Returns
bool success

References mpFirstRow, mpHeaderRow, and mpLastRow.

◆ setHeaderRow()

bool CExperiment::setHeaderRow ( const unsigned C_INT32 headerRow)

Set the header row containing data

Parameters
constunsigned C_INT32 & headerRow
Returns
bool success

References mpFirstRow, mpHeaderRow, and mpLastRow.

◆ setIsRowOriented()

bool CExperiment::setIsRowOriented ( const bool &  isRowOriented)

Set whether the data is row oriented. This only impacts reading the data from a stream

Parameters
constbool & isRowOriented
Returns
bool success

References isRowOriented(), and mpRowOriented.

◆ setLastRow()

bool CExperiment::setLastRow ( const unsigned C_INT32 lastRow)

Set the last row containing data

Parameters
constunsigned C_INT32 & lastRow
Returns
bool success

References mpFirstRow, mpHeaderRow, and mpLastRow.

◆ setNormalizeWeightsPerExperiment()

void CExperiment::setNormalizeWeightsPerExperiment ( bool  flag)

◆ setNumColumns()

bool CExperiment::setNumColumns ( const unsigned C_INT32 cols)

Set the number of columns in a stream

Parameters
constunsigned C_INT32 & cols
Returns
bool success

References mpNumColumns.

◆ setSeparator()

bool CExperiment::setSeparator ( const std::string &  seperator)

Set the seperator used when reading a stream

Parameters
conststd::string & separator
Returns
bool success

References mpSeparator.

◆ setWeightMethod()

bool CExperiment::setWeightMethod ( const WeightMethod weightMethod)

Set the weight calculation method and resets manual adjusted weights

Parameters
constWeightMethod & weightMethod
Returns
bool success

References mpObjectMap, mpWeightMethod, and CExperimentObjectMap::CDataColumn::setScale().

◆ storeExtendedTimeSeriesData()

void CExperiment::storeExtendedTimeSeriesData ( C_FLOAT64  time)

Add one dataset to the extended time series. The time and the simulated dependent values are stored and the iterator is increased

References CMathContainer::applyUpdateSequence(), CVectorCore< CType >::array(), C_FLOAT64, mDataDependent, mDependentUpdateSequence, mDependentValues, mpContainer, mStorageIt, CMatrix< CType >::numCols(), and time.

Referenced by CFitProblem::calculate(), and CFitProblem::calculateCrossValidation().

◆ sumOfSquares()

C_FLOAT64 CExperiment::sumOfSquares ( const size_t &  index,
C_FLOAT64 *&  residuals 
) const

Calculate the sum of squares for the indexed row of the experiment. If residuals is not NULL residuals will contain the differences between the calculated and the experiment values.

Parameters
constsize_t & index
C_FLOAT64*& residuals (may be NULL)
Returns
C_FLOAT64 sumOfSquares

References CMathContainer::applyUpdateSequence(), CVectorCore< CType >::array(), C_FLOAT64, max, mDataDependent, mDependentUpdateSequence, mDependentValues, mMissingData, mpContainer, mScale, and CMatrix< CType >::numCols().

Referenced by CFitProblem::calculate(), and CFitProblem::calculateCrossValidation().

◆ sumOfSquaresStore()

C_FLOAT64 CExperiment::sumOfSquaresStore ( const size_t &  index,
C_FLOAT64 *&  dependentValues 
)

Calculate the sum of squares for the indexed row of the experiment. On return dependentValues contains the calculated values. If residuals is not NULL residuals will contain the differences between the calculated and the experiment values.

Parameters
constsize_t & index
C_FLOAT64*& dependentValues (must not be NULL)
Returns
C_FLOAT64 sumOfSquares

References CMathContainer::applyUpdateSequence(), CVectorCore< CType >::array(), C_FLOAT64, max, mDataDependent, mDependentUpdateSequence, mDependentValues, mMissingData, mpContainer, mpDataDependentCalculated, mScale, and CMatrix< CType >::numCols().

Referenced by CFitProblem::calculate(), and CFitProblem::calculateCrossValidation().

◆ updateFittedPoints()

void CExperiment::updateFittedPoints ( )

◆ updateFittedPointValues()

void CExperiment::updateFittedPointValues ( const size_t &  index)

This method is used for output to fill the fitted points with the values of the index data record. If index exceeds the number of data records all values are set to NaN.

References CDataVector< CType >::begin(), C_FLOAT64, CDataVector< CType >::end(), mDataDependent, mDataTime, mFittingPoints, mNumDataRows, mpDataDependentCalculated, mpTaskType, mScale, CMatrix< CType >::numCols(), and CTaskEnum::timeCourse.

◆ updateFittedPointValuesFromExtendedTimeSeries()

void CExperiment::updateFittedPointValuesFromExtendedTimeSeries ( const size_t &  index)

◆ updateModelWithIndependentData()

bool CExperiment::updateModelWithIndependentData ( const size_t &  index)

Friends And Related Function Documentation

◆ operator==

bool operator== ( const CExperiment lhs,
const CExperiment rhs 
)
friend

Comparison operator

Parameters
constCExperiment & lhs
constCExperiment & rhs
Returns
bool equal

Member Data Documentation

◆ mColumnName

std::vector< std::string > CExperiment::mColumnName
private

The column names if available after reading a file

Referenced by getColumnNames(), read(), and readColumnNames().

◆ mColumnObjectiveValue

CVector< C_FLOAT64 > CExperiment::mColumnObjectiveValue
private

◆ mColumnRMS

CVector< C_FLOAT64 > CExperiment::mColumnRMS
private

◆ mColumnScale

CVector< C_FLOAT64 > CExperiment::mColumnScale
private

◆ mColumnValidValueCount

CVector< size_t > CExperiment::mColumnValidValueCount
private

◆ mDataDependent

◆ mDataIndependent

CMatrix< C_FLOAT64 > CExperiment::mDataIndependent
private

The relevant independent experimental data after reading a file

Referenced by compile(), getIndependentData(), read(), and updateModelWithIndependentData().

◆ mDataTime

CVector< C_FLOAT64 > CExperiment::mDataTime
private

The vector of time points

Referenced by getTimeData(), printResult(), read(), and updateFittedPointValues().

◆ mDefaultColumnScale

CVector< C_FLOAT64 > CExperiment::mDefaultColumnScale
private

◆ mDependentObjectsMap

std::map< const CObjectInterface *, size_t > CExperiment::mDependentObjectsMap
private

A map of all dependent data objects to dependent data columns

Referenced by compile(), getColumnValidValueCount(), getDefaultScale(), getDependentObjectsMap(), getErrorMeanSD(), getErrorSum(), getObjectiveValue(), getRMS(), and getScale().

◆ mDependentUpdateSequence

CCore::CUpdateSequence CExperiment::mDependentUpdateSequence
private

◆ mDependentValues

CVector< C_FLOAT64 * > CExperiment::mDependentValues
private

Pointer to the actual independent values in the model in the order in which they occur as colums in the file, which is also the order in which the numbers are stored in the various internal data structures

Referenced by compile(), storeExtendedTimeSeriesData(), sumOfSquares(), and sumOfSquaresStore().

◆ mExtendedTimeSeries

CVector< C_FLOAT64 > CExperiment::mExtendedTimeSeries
private

◆ mExtendedTimeSeriesSize

size_t CExperiment::mExtendedTimeSeriesSize
private

◆ mFittingPoints

◆ mIndependentObjects

CObjectInterface::ObjectSet CExperiment::mIndependentObjects
private

Referenced by compile(), and getIndependentObjects().

◆ mIndependentUpdateSequence

CCore::CUpdateSequence CExperiment::mIndependentUpdateSequence
private

◆ mIndependentValues

CVector< C_FLOAT64 * > CExperiment::mIndependentValues
private

◆ mMean

C_FLOAT64 CExperiment::mMean
private

◆ mMeans

CVector< C_FLOAT64 > CExperiment::mMeans
private

Referenced by calculateWeights(), and read().

◆ mMeanSD

C_FLOAT64 CExperiment::mMeanSD
private

◆ mMissingData

bool CExperiment::mMissingData
private

Indicates whether we have missing data

Referenced by calculateWeights(), sumOfSquares(), and sumOfSquaresStore().

◆ mNumDataRows

size_t CExperiment::mNumDataRows
private

◆ mObjectiveValue

C_FLOAT64 CExperiment::mObjectiveValue
private

◆ mpContainer

◆ mpDataDependentCalculated

C_FLOAT64* CExperiment::mpDataDependentCalculated
private

The relevant dependent experimental data after reading a file

Referenced by calculateStatistics(), getErrorMeanSD(), getErrorSum(), printResult(), read(), sumOfSquaresStore(), and updateFittedPointValues().

◆ mpFileName

std::string* CExperiment::mpFileName
private

◆ mpFirstRow

unsigned C_INT32* CExperiment::mpFirstRow
private

◆ mpHeaderRow

unsigned C_INT32* CExperiment::mpHeaderRow
private

◆ mpLastRow

unsigned C_INT32* CExperiment::mpLastRow
private

◆ mpNormalizeWeightsPerExperiment

bool* CExperiment::mpNormalizeWeightsPerExperiment
private

Indicates whether the weights of this experiment should be normalized to 1

Referenced by calculateWeights(), getNormalizeWeightsPerExperiment(), initializeParameter(), operator=(), and setNormalizeWeightsPerExperiment().

◆ mpNumColumns

unsigned C_INT32* CExperiment::mpNumColumns
private

◆ mpObjectMap

CExperimentObjectMap* CExperiment::mpObjectMap
private

◆ mpRowOriented

bool* CExperiment::mpRowOriented
private

This is realized as a CCopasiParameter type BOOL

Referenced by initializeParameter(), isRowOriented(), operator=(), and setIsRowOriented().

◆ mpSeparator

std::string* CExperiment::mpSeparator
private

◆ mpTaskType

◆ mpWeightMethod

WeightMethod* CExperiment::mpWeightMethod
private

◆ mRMS

C_FLOAT64 CExperiment::mRMS
private

◆ mRowObjectiveValue

CVector< C_FLOAT64 > CExperiment::mRowObjectiveValue
private

◆ mRowRMS

CVector< C_FLOAT64 > CExperiment::mRowRMS
private

◆ mScale

◆ mStorageIt

C_FLOAT64* CExperiment::mStorageIt
private

◆ mValidValueCount

size_t CExperiment::mValidValueCount
private

◆ TypeName

const std::string CExperiment::TypeName
static
Initial value:
=
{
"ignored",
"independent",
"dependent",
"Time",
""
}

String literals for the GUI to display type names of columns known to COPASI.

◆ WeightMethodName

const std::string CExperiment::WeightMethodName
static
Initial value:
=
{
"Mean",
"Mean Square",
"Standard Deviation",
"Value Scaling",
""
}

String literals for the GUI to display weight method known to COPASI.

◆ WeightMethodType

const char * CExperiment::WeightMethodType
static
Initial value:
=
{
"Mean",
"MeanSquare",
"StandardDeviation",
"ValueScaling",
NULL
}

XML type names of weight methods known to COPASI.

◆ XMLType

const char * CExperiment::XMLType
static
Initial value:
=
{
"ignored",
"independent",
"dependent",
"time",
NULL
}

XML type names of tasks known to COPASI.


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