copasi API  0.1
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
CExperiment Class Reference

#include <CExperiment.h>

Inheritance diagram for CExperiment:
CCopasiParameterGroup CCopasiParameter CCopasiContainer CCopasiObject

List of all members.

Public Types

enum  Type { ignore = 0, independent, dependent, time }
enum  WeightMethod { MEAN = 0, MEAN_SQUARE, SD }

Public Member Functions

 CExperiment (const CCopasiContainer *pParent, const std::string &name="Experiment")
 CExperiment (const CExperiment &src, const CCopasiContainer *pParent=NULL)
 CExperiment (const CCopasiParameterGroup &group, const CCopasiContainer *pParent=NULL)
virtual ~CExperiment ()
CExperimentoperator= (const CExperiment &rhs)
virtual bool elevateChildren ()
bool compile (const std::vector< CCopasiContainer * > listOfContainer=CCopasiContainer::EmptyList)
bool read (std::istream &in, unsigned C_INT32 &currentLine)
bool calculateWeights ()
const std::map< CCopasiObject
*, unsigned C_INT32 > & 
getDependentObjects () const
C_FLOAT64 sumOfSquares (const unsigned C_INT32 &index, C_FLOAT64 *&residuals) const
C_FLOAT64 sumOfSquaresStore (const unsigned C_INT32 &index, C_FLOAT64 *&dependentValues)
bool calculateStatistics ()
bool readColumnNames ()
unsigned C_INT32 guessColumnNumber () const
const std::vector< std::string > & getColumnNames () const
bool updateModelWithIndependentData (const unsigned C_INT32 &index)
bool restoreModelIndependentData ()
bool setExperimentType (const CCopasiTask::Type &type)
const CCopasiTask::TypegetExperimentType () const
const CVector< C_FLOAT64 > & getTimeData () const
const CMatrix< C_FLOAT64 > & getIndependentData () const
const CMatrix< C_FLOAT64 > & getDependentData () const
const std::string & getFileName () const
bool setFileName (const std::string &fileName)
CExperimentObjectMapgetObjectMap ()
const CCopasiVector
< CFittingPoint > & 
getFittingPoints () const
void updateFittedPoints ()
void updateFittedPointValues (const unsigned C_INT32 &index)
const unsigned C_INT32 & getNumColumns () const
bool setNumColumns (const unsigned C_INT32 &cols)
const unsigned C_INT32 & getFirstRow () const
bool setFirstRow (const unsigned C_INT32 &firstRow)
const unsigned C_INT32 & getLastRow () const
bool setLastRow (const unsigned C_INT32 &lastRow)
const unsigned C_INT32 & getHeaderRow () const
bool setHeaderRow (const unsigned C_INT32 &headerRow)
unsigned C_INT32 getNumDataRows () const
const std::string & getSeparator () const
bool setSeparator (const std::string &seperator)
const WeightMethodgetWeightMethod () const
bool setWeightMethod (const WeightMethod &weightMethod)
const bool & isRowOriented () const
bool setIsRowOriented (const bool &isRowOriented)
virtual void printResult (std::ostream *ostream) const
const C_FLOAT64 & getObjectiveValue () const
const C_FLOAT64 & getRMS () const
const C_FLOAT64 & getErrorMean () const
const C_FLOAT64 & getErrorMeanSD () const
C_FLOAT64 getObjectiveValue (CCopasiObject *const &pObject) const
C_FLOAT64 getDefaultWeight (const CCopasiObject *const &pObject) const
C_FLOAT64 getRMS (CCopasiObject *const &pObject) const
C_FLOAT64 getErrorMean (CCopasiObject *const &pObject) const
C_FLOAT64 getErrorMeanSD (CCopasiObject *const &pObject, const C_FLOAT64 &errorMean) const
unsigned C_INT32 getCount (CCopasiObject *const &pObject) const

Static Public Member Functions

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

Static Public Attributes

static const std::string TypeName []
static const char * XMLType []
static const std::string WeightMethodName []
static const char * WeightMethodType []

Friends

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

Member Enumeration Documentation

Enumeration of the types of columns known to COPASI.

Enumerator:
ignore 
independent 
dependent 
time 

Reimplemented from CCopasiParameter.

Enumaration of methods to calculate the weight.

Enumerator:
MEAN 
MEAN_SQUARE 
SD 

Constructor & Destructor Documentation

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

Default constructor

Parameters:
constCCopasiContainer * pParent
conststd::string & name (default: Experiment)
CExperiment::CExperiment ( const CExperiment src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters:
constCExperiment & src
constCCopasiContainer * pParent (default: src data model)
CExperiment::CExperiment ( const CCopasiParameterGroup group,
const CCopasiContainer pParent = NULL 
)

Specific constructor used for reading COPASI files

Parameters:
constCCopasiParameterGroup & group
constCCopasiContainer * pParent (default: group data model)
CExperiment::~CExperiment ( ) [virtual]

Destructor


Member Function Documentation

bool CExperiment::calculateStatistics ( )

Calculate statistics by comparing the stored calculated values with the measurements.

Returns:
bool success
bool CExperiment::calculateWeights ( )

Calculate/set the weights used in the sum of squares.

Returns:
bool success
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
bool CExperiment::compile ( const std::vector< CCopasiContainer * >  listOfContainer = CCopasiContainer::EmptyList)

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

Parameters:
conststd::vector< CCopasiContainer * > listOfContainer
Returns:
bool success
bool CExperiment::elevateChildren ( ) [virtual]

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

Returns:
bool success

Reimplemented from CCopasiParameterGroup.

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

Retrieve the column names

Returns:
const std::vector< std::string > & columnNames;
unsigned C_INT32 CExperiment::getCount ( CCopasiObject *const &  pObject) const

Retrieve the data point caount for the object.

Parameters:
CCopasiObject*const& pObject
Returns:
unsigned C_INT32 count
C_FLOAT64 CExperiment::getDefaultWeight ( const CCopasiObject *const &  pObject) const

Retrieve the default weight for the object.

Parameters:
CCopasiObject*const& pObject
Returns:
C_FLOAT64 weight
const CMatrix< C_FLOAT64 > & CExperiment::getDependentData ( ) const

Retrieve the dependent data of the experiment.

Returns:
const CMatrix< C_FLOAT64 > & dependentData
const std::map< CCopasiObject *, unsigned C_INT32 > & CExperiment::getDependentObjects ( ) const

Retrieve the list of dependent data objects

Returns:
const std::map< CCopasiObject *, unsigned C_INT32 > & dependentObjects
const C_FLOAT64 & CExperiment::getErrorMean ( ) const

Retrieve the mean of the error

Parameters:
constC_FLOAT64 & errorMean
C_FLOAT64 CExperiment::getErrorMean ( CCopasiObject *const &  pObject) const

Retrieve the error mean for the object.

Parameters:
CCopasiObject*const& pObject
Returns:
C_FLOAT64 errorMean
const C_FLOAT64 & CExperiment::getErrorMeanSD ( ) const

Retrieve the std. deviation of the error

Parameters:
constC_FLOAT64 & errorMeanSD
C_FLOAT64 CExperiment::getErrorMeanSD ( CCopasiObject *const &  pObject,
const C_FLOAT64 &  errorMean 
) const

Retrieve the error mean std. deviations for the object.

Parameters:
CCopasiObject*const& pObject
C_FLOAT64errorMean
Returns:
C_FLOAT64 errorMeanSD
const CCopasiTask::Type & CExperiment::getExperimentType ( ) const

Retrieve the experiment type

Returns:
const CCopasiTask::Type & experimentType
const std::string & CExperiment::getFileName ( ) const

Retrieve the file name

Returns:
const std::string & fileName
const unsigned C_INT32 & CExperiment::getFirstRow ( ) const

Retrieve the first row

Returns:
const unsigned C_INT32 & firstRow
const CCopasiVector< CFittingPoint > & CExperiment::getFittingPoints ( ) const

Retrieve the list of fitting points

Returns:
const CCopasiVector< CFittingPoint > & fittingPoints
const unsigned C_INT32 & CExperiment::getHeaderRow ( ) const

Retrieve the header row

Returns:
const unsigned C_INT32 & headerRow
const CMatrix< C_FLOAT64 > & CExperiment::getIndependentData ( ) const

Retrieve the independent data of the experiment.

Returns:
const CMatrix< C_FLOAT64 > & independentData
const unsigned C_INT32 & CExperiment::getLastRow ( ) const

Retrieve the last row

Returns:
const unsigned C_INT32 & lastRow
const unsigned C_INT32 & CExperiment::getNumColumns ( ) const

Retrieve the number of columns

Returns:
const unsigned C_INT32 & numColumns
unsigned C_INT32 CExperiment::getNumDataRows ( ) const

Retrieve the number of data rows

Returns:
const unsigned C_INT32 numDataRows
const C_FLOAT64 & CExperiment::getObjectiveValue ( ) const

Retrieve the value of the objective function

Parameters:
constC_FLOAT64 & errorMean
C_FLOAT64 CExperiment::getObjectiveValue ( CCopasiObject *const &  pObject) const

Retrieve the objective value for the object.

Parameters:
CCopasiObject*const& pObject
Returns:
C_FLOAT64 objectiveValue
CExperimentObjectMap & CExperiment::getObjectMap ( )

Retrieve the object map

Returns:
CExperimentObjectMap & mpObjectMap
const C_FLOAT64 & CExperiment::getRMS ( ) const

Retrieve the RMS

Parameters:
constC_FLOAT64 & RMS
C_FLOAT64 CExperiment::getRMS ( CCopasiObject *const &  pObject) const

Retrieve the RMS for the object.

Parameters:
CCopasiObject*const& pObject
Returns:
C_FLOAT64 RMS
const std::string & CExperiment::getSeparator ( ) const

Retrieve the separator

Returns:
const std::string & separator
const CVector< C_FLOAT64 > & CExperiment::getTimeData ( ) const

Retrieve the time data of the experiment.

Returns:
const CVector< C_FLOAT64 > & timeData
const CExperiment::WeightMethod & CExperiment::getWeightMethod ( ) const

Retrieve the method used for calculating the default weights.

Returns:
const WeightMethod & weightMethod
unsigned C_INT32 CExperiment::guessColumnNumber ( ) const

Try to guess the number of columns

Returns:
unsigned C_INT32 numColumns
const bool & CExperiment::isRowOriented ( ) const

Check whter the data is row oriented.

Returns:
const bool & isRowOriented
CExperiment & CExperiment::operator= ( const CExperiment rhs)

Assignement operator

Parameters:
constCExperiment & rhs
Returns:
CExperiment & lhs
void CExperiment::printResult ( std::ostream *  ostream) const [virtual]

This is the output method for the statistics for the experiment. This method is called from CFitProblem::printResult.

Parameters:
std::ostream* ostream
bool CExperiment::read ( std::istream &  in,
unsigned C_INT32 &  currentLine 
)

Reads the experiment data form a the given stream

Parameters:
std::istream& in
unsignedC_INT32 & currentLine
Returns:
bool success
bool CExperiment::readColumnNames ( )

Reads the header row for the experiment data

Returns:
bool success
bool CExperiment::restoreModelIndependentData ( )

Restore the model with the independent data from before the experiment

Returns:
bool success
bool CExperiment::setExperimentType ( const CCopasiTask::Type type)

set the experiment type

Parameters:
constCCopasiTask::Type & experimentType
Returns:
bool success
bool CExperiment::setFileName ( const std::string &  fileName)

Set the file name

Parameters:
conststd::string & fileName
Returns:
bool success
bool CExperiment::setFirstRow ( const unsigned C_INT32 &  firstRow)

Set the first row containing data

Parameters:
constunsigned C_INT32 & firstRow
Returns:
bool success
bool CExperiment::setHeaderRow ( const unsigned C_INT32 &  headerRow)

Set the header row containing data

Parameters:
constunsigned C_INT32 & headerRow
Returns:
bool success
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
bool CExperiment::setLastRow ( const unsigned C_INT32 &  lastRow)

Set the last row containing data

Parameters:
constunsigned C_INT32 & lastRow
Returns:
bool success
bool CExperiment::setNumColumns ( const unsigned C_INT32 &  cols)

Set the number of columns in a stream

Parameters:
constunsigned C_INT32 & cols
Returns:
bool success
bool CExperiment::setSeparator ( const std::string &  seperator)

Set the seperator used when reading a stream

Parameters:
conststd::string & separator
Returns:
bool success
bool CExperiment::setWeightMethod ( const WeightMethod weightMethod)

Set the weight calculation method and resets manual adjusted weights

Parameters:
constWeightMethod & weightMethod
Returns:
bool success
C_FLOAT64 CExperiment::sumOfSquares ( const unsigned C_INT32 &  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:
constunsigned C_INT32 & index
C_FLOAT64*& residuals (may be NULL)
Returns:
C_FLOAT64 sumOfSquares
C_FLOAT64 CExperiment::sumOfSquaresStore ( const unsigned C_INT32 &  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:
constunsigned C_INT32 & index
C_FLOAT64*& dependentValues (must not be NULL)
Returns:
C_FLOAT64 sumOfSquares
void CExperiment::updateFittedPoints ( )

This method needs to be called whenever the Object Map is changed

void CExperiment::updateFittedPointValues ( const unsigned C_INT32 &  index)

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

bool CExperiment::updateModelWithIndependentData ( const unsigned C_INT32 &  index)

Update the model with the independent data of the experiment

Parameters:
constunsigned C_INT32 & index
Returns:
bool success

Friends And Related Function Documentation

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

Comparison operator

Parameters:
constCExperiment & lhs
constCExperiment & rhs
Returns:
bool equal

Member Data Documentation

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.

Reimplemented from CCopasiParameter.

const std::string CExperiment::WeightMethodName [static]
Initial value:
{
  "Mean",
  "Mean Square",
  "Standard Deviation",
  ""
}

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

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

XML type names of weight methods known to COPASI.

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

XML type names of tasks known to COPASI.

Reimplemented from CCopasiParameter.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines