COPASI API  4.40.278
CTimeSeries Class Reference

#include <CTimeSeries.h>

Inheritance diagram for CTimeSeries:
[legend]

Public Member Functions

void allocate (const size_t &steps)
 
void clear ()
 
virtual bool compile (CObjectInterface::ContainerList listOfContainer)
 
 CTimeSeries ()
 
 CTimeSeries (const CTimeSeries &src)
 
virtual void finish ()
 
C_FLOAT64 getConcentrationData (const size_t &step, const size_t &variable) const
 
const C_FLOAT64getData (const size_t &step, const size_t &variable) const
 
const std::string & getKey (const size_t &variable) const
 
const size_t & getNumVariables () const
 
const size_t & getRecordedSteps () const
 
std::string getSBMLId (const size_t &variable, const CDataModel *pDataModel) const
 
const std::string & getTitle (const size_t &variable) const
 
void increaseAllocation ()
 
virtual void output (const Activity &activity)
 
int save (const std::string &fileName, bool writeParticleNumbers=false, const std::string &separator="\t") const
 
int save (std::ostream &str, bool writeParticleNumbers=false, const std::string &separator="\t") const
 
virtual void separate (const Activity &activity)
 
 ~CTimeSeries ()
 
- Public Member Functions inherited from COutputInterface
virtual void close ()
 
 COutputInterface ()
 
 COutputInterface (const COutputInterface &src)
 
virtual const CObjectInterface::ObjectSetgetObjects () const
 
virtual ~COutputInterface ()
 

Private Member Functions

CTimeSeriesoperator= (const CTimeSeries &)
 

Private Attributes

size_t mAllocatedSteps
 
CVector< size_t > mCompartment
 
CVectorCore< C_FLOAT64mContainerValues
 
std::vector< std::string > mKeys
 
C_FLOAT64 mNumberToQuantityFactor
 
size_t mNumVariables
 
C_FLOAT64mpEnd
 
C_FLOAT64mpIt
 
CVector< size_t > mPivot
 
size_t mRecordedSteps
 
std::vector< std::string > mTitles
 

Static Private Attributes

static C_FLOAT64 mDummyFloat
 
static std::string mDummyString
 

Additional Inherited Members

- Public Types inherited from COutputInterface
enum  Activity { BEFORE = 0x01 , DURING = 0x02 , AFTER = 0x04 , MONITORING = 0x08 }
 
- Protected Types inherited from CMatrix< C_FLOAT64 >
typedef C_FLOAT64 elementType
 
- Protected Member Functions inherited from CMatrix< C_FLOAT64 >
bool applyPivot (const CVector< size_t > &pivot)
 
virtual C_FLOAT64array ()
 
virtual const C_FLOAT64array () const
 
 CMatrix (const CMatrix< C_FLOAT64 > &src)
 
 CMatrix (size_t rows=0, size_t cols=0)
 
virtual size_t numCols () const
 
virtual size_t numRows () const
 
virtual elementTypeoperator() (const size_t &row, const size_t &col)
 
virtual const elementTypeoperator() (const size_t &row, const size_t &col) const
 
virtual CMatrix< C_FLOAT64 > & operator= (const C_FLOAT64 &value)
 
virtual CMatrix< C_FLOAT64 > & operator= (const CMatrix< C_FLOAT64 > &rhs)
 
virtual C_FLOAT64operator[] (size_t row)
 
virtual const C_FLOAT64operator[] (size_t row) const
 
virtual void resize (size_t rows, size_t cols, const bool &copy=false)
 
virtual size_t size () const
 
virtual ~CMatrix ()
 
- Protected Attributes inherited from COutputInterface
CObjectInterface::ObjectSet mObjects
 
- Protected Attributes inherited from CMatrix< C_FLOAT64 >
size_t mCols
 
C_FLOAT64mpBuffer
 
size_t mRows
 

Constructor & Destructor Documentation

◆ CTimeSeries() [1/2]

CTimeSeries::CTimeSeries ( )

Default constructor

◆ CTimeSeries() [2/2]

CTimeSeries::CTimeSeries ( const CTimeSeries src)

Copy constructor

Parameters
constCTimeSeries & src

References CVectorCore< CType >::initialize(), and mContainerValues.

◆ ~CTimeSeries()

CTimeSeries::~CTimeSeries ( )

Destructor

Member Function Documentation

◆ allocate()

void CTimeSeries::allocate ( const size_t &  steps)

The maximal number of recorded steps. This must be set before compiling

Parameters
constsize_t & steps

References mAllocatedSteps.

Referenced by CTimeSensTask::initialize(), CTrajectoryTask::initialize(), and CTSSATask::initialize().

◆ clear()

◆ compile()

◆ finish()

void CTimeSeries::finish ( )
virtual

Finish the output

Implements COutputInterface.

◆ getConcentrationData()

C_FLOAT64 CTimeSeries::getConcentrationData ( const size_t &  step,
const size_t &  variable 
) const

Retrieve the data (concentration for species) for the indexed step and variable

Parameters
constsize_t & step
constsize_t & variable
Returns
const C_FLOAT64 & data

References C_INVALID_INDEX, CMatrix< C_FLOAT64 >::mCols, mCompartment, mDummyFloat, mNumberToQuantityFactor, mNumVariables, CMatrix< C_FLOAT64 >::mpBuffer, mPivot, and mRecordedSteps.

Referenced by save().

◆ getData()

const C_FLOAT64 & CTimeSeries::getData ( const size_t &  step,
const size_t &  variable 
) const

Retrieve the data (particle number for species) for the indexed step and variable

Parameters
constsize_t & step
constsize_t & variable
Returns
const C_FLOAT64 & data

References CMatrix< C_FLOAT64 >::mCols, mDummyFloat, mNumVariables, CMatrix< C_FLOAT64 >::mpBuffer, mPivot, and mRecordedSteps.

Referenced by save().

◆ getKey()

const std::string & CTimeSeries::getKey ( const size_t &  variable) const

Retrieve the key of the model entity of the indexed variable (column)

Parameters
constsize_t & variable
Returns
const std::string & key

References mDummyString, mKeys, mNumVariables, and mPivot.

Referenced by getSBMLId().

◆ getNumVariables()

const size_t & CTimeSeries::getNumVariables ( ) const

Retrieve the number of variables (columns)

Returns
size_t & numVariables

References mNumVariables.

Referenced by save().

◆ getRecordedSteps()

const size_t & CTimeSeries::getRecordedSteps ( ) const

Retrieve the number of time steps (rows)

Returns
const size_t & recordedSteps

References mRecordedSteps.

◆ getSBMLId()

std::string CTimeSeries::getSBMLId ( const size_t &  variable,
const CDataModel pDataModel 
) const

get the id of the SBML object corresponding to column indexed by variable. If there is no corresponding SBML object (e.g. if the model comes from a COPASI file) the empty string is returned.

Parameters
constsize_t & variable
Returns
const std::string SBMLId

References CKeyFactory::get(), CDataModel::getCopasi2SBMLMap(), getKey(), CRootContainer::getKeyFactory(), and mDummyString.

◆ getTitle()

const std::string & CTimeSeries::getTitle ( const size_t &  variable) const

Retrieve the title of the indexed variable (column)

Parameters
constsize_t & variable
Returns
const std::string & title

References mDummyString, mNumVariables, mPivot, and mTitles.

Referenced by save().

◆ increaseAllocation()

void CTimeSeries::increaseAllocation ( )

◆ operator=()

CTimeSeries& CTimeSeries::operator= ( const CTimeSeries )
private

◆ output()

void CTimeSeries::output ( const Activity activity)
virtual

Perform an output event for the current activity

Parameters
constActivity & activity

Implements COutputInterface.

References CVectorCore< CType >::array(), C_FLOAT64, COutputInterface::DURING, increaseAllocation(), CMatrix< C_FLOAT64 >::mCols, mContainerValues, mpEnd, mpIt, and mRecordedSteps.

◆ save() [1/2]

int CTimeSeries::save ( const std::string &  fileName,
bool  writeParticleNumbers = false,
const std::string &  separator = "\t" 
) const

Save the time series to a file

Parameters
conststd::string & fileName
boolwriteParticleNumbers (default: false)
conststd::string& separator (default: "\t")
Returns
int retcode

References CLocaleString::fromUtf8().

Referenced by CTrajectoryProblem::printResult().

◆ save() [2/2]

int CTimeSeries::save ( std::ostream &  str,
bool  writeParticleNumbers = false,
const std::string &  separator = "\t" 
) const

Save the time series to the given stream

Parameters
strthe stream to write the series to
boolwriteParticleNumbers (default: false)
conststd::string& separator (default: "\t")
Returns
int retcode

References C_FLOAT64, getConcentrationData(), getData(), getNumVariables(), getTitle(), and mRecordedSteps.

◆ separate()

void CTimeSeries::separate ( const Activity activity)
virtual

Introduce an additional separator into the output

Parameters
constActivity & activity

Implements COutputInterface.

References C_FLOAT64, increaseAllocation(), CMatrix< C_FLOAT64 >::mCols, mpEnd, mpIt, and mRecordedSteps.

Member Data Documentation

◆ mAllocatedSteps

size_t CTimeSeries::mAllocatedSteps
private

The number of allocated steps

Referenced by allocate(), clear(), compile(), and increaseAllocation().

◆ mCompartment

CVector< size_t > CTimeSeries::mCompartment
private

Vector of indexes pointing to the column storing the volume of the containing compartment for a species (C_INVALID_INDEX otherwise)

Referenced by clear(), compile(), and getConcentrationData().

◆ mContainerValues

CVectorCore< C_FLOAT64 > CTimeSeries::mContainerValues
private

A reference to the values of the math container

Referenced by compile(), CTimeSeries(), and output().

◆ mDummyFloat

C_FLOAT64 CTimeSeries::mDummyFloat
staticprivate

Static C_FLOAT64 0.0 for performance reasons

Referenced by getConcentrationData(), and getData().

◆ mDummyString

std::string CTimeSeries::mDummyString
staticprivate

Static empty string for performance reasons

Referenced by getKey(), getSBMLId(), and getTitle().

◆ mKeys

std::vector< std::string > CTimeSeries::mKeys
private

Vector storing the keys for the model entity represented by each column

Referenced by clear(), compile(), and getKey().

◆ mNumberToQuantityFactor

C_FLOAT64 CTimeSeries::mNumberToQuantityFactor
private

Conversion factor needed for computing concentration data

Referenced by clear(), compile(), and getConcentrationData().

◆ mNumVariables

size_t CTimeSeries::mNumVariables
private

The number of variables exposed

Referenced by clear(), compile(), getConcentrationData(), getData(), getKey(), getNumVariables(), and getTitle().

◆ mpEnd

C_FLOAT64* CTimeSeries::mpEnd
private

Iterator pointing beyond the last allocated step (row)

Referenced by clear(), compile(), increaseAllocation(), output(), and separate().

◆ mpIt

C_FLOAT64* CTimeSeries::mpIt
private

Iterator pointing the next step (row) to be recorded

Referenced by clear(), compile(), increaseAllocation(), output(), and separate().

◆ mPivot

CVector< size_t > CTimeSeries::mPivot
private

Pivot rearranging the columns to a more user friendly order

Referenced by clear(), compile(), getConcentrationData(), getData(), getKey(), and getTitle().

◆ mRecordedSteps

size_t CTimeSeries::mRecordedSteps
private

The number of actually recorded steps

Referenced by clear(), compile(), getConcentrationData(), getData(), getRecordedSteps(), increaseAllocation(), output(), save(), and separate().

◆ mTitles

std::vector< std::string > CTimeSeries::mTitles
private

Vector of column titles.

Referenced by clear(), compile(), and getTitle().


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