COPASI API
4.40.278
|
#include <CTimeSeries.h>
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_FLOAT64 & | getData (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::ObjectSet & | getObjects () const |
virtual | ~COutputInterface () |
Private Member Functions | |
CTimeSeries & | operator= (const CTimeSeries &) |
Private Attributes | |
size_t | mAllocatedSteps |
CVector< size_t > | mCompartment |
CVectorCore< C_FLOAT64 > | mContainerValues |
std::vector< std::string > | mKeys |
C_FLOAT64 | mNumberToQuantityFactor |
size_t | mNumVariables |
C_FLOAT64 * | mpEnd |
C_FLOAT64 * | mpIt |
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_FLOAT64 * | array () |
virtual const C_FLOAT64 * | array () 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 elementType & | operator() (const size_t &row, const size_t &col) |
virtual const elementType & | operator() (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_FLOAT64 * | operator[] (size_t row) |
virtual const C_FLOAT64 * | operator[] (size_t row) const |
virtual void | resize (size_t rows, size_t cols, const bool ©=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_FLOAT64 * | mpBuffer |
size_t | mRows |
CTimeSeries::CTimeSeries | ( | ) |
Default constructor
CTimeSeries::CTimeSeries | ( | const CTimeSeries & | src | ) |
Copy constructor
const | CTimeSeries & src |
References CVectorCore< CType >::initialize(), and mContainerValues.
CTimeSeries::~CTimeSeries | ( | ) |
Destructor
void CTimeSeries::allocate | ( | const size_t & | steps | ) |
The maximal number of recorded steps. This must be set before compiling
const | size_t & steps |
References mAllocatedSteps.
Referenced by CTimeSensTask::initialize(), CTrajectoryTask::initialize(), and CTSSATask::initialize().
void CTimeSeries::clear | ( | ) |
Clear the time series
References mAllocatedSteps, mCompartment, mKeys, mNumberToQuantityFactor, mNumVariables, COutputInterface::mObjects, CMatrix< C_FLOAT64 >::mpBuffer, mpEnd, mpIt, mPivot, mRecordedSteps, CMatrix< C_FLOAT64 >::mRows, mTitles, CMatrix< CType >::resize(), CVector< CType >::resize(), and CMatrix< C_FLOAT64 >::size().
Referenced by CTimeSensTask::initialize(), CTrajectoryTask::initialize(), and CTSSATask::initialize().
|
virtual |
compile the object list from name vector
CObjectInterface::ContainerList | listOfContainer |
const | CDataModel* pDataModel |
Implements COutputInterface.
References CMath::__SIZE, CVectorCore< CType >::array(), CMath::Assignment, C_FLOAT64, C_INVALID_INDEX, CMath::Conversion, CObjectInterface::DataObject(), CMath::Dependent, CMath::EventTarget, CMath::Fixed, CMetab::getCompartment(), CMathContainer::getCountAssignments(), CMathContainer::getCountDependentSpecies(), CMathContainer::getCountFixed(), CMathContainer::getCountFixedEventTargets(), CMathContainer::getCountIndependentSpecies(), CMathContainer::getCountODEs(), CMetabNameInterface::getDisplayName(), CDataObject::getKey(), CMathContainer::getMathObject(), CMathContainer::getModel(), CModel::getNumber2QuantityFactor(), CDataObject::getObjectDisplayName(), CDataObject::getObjectParent(), CMathObject::getSimulationType(), CMathContainer::getState(), CModelEntity::getValueReference(), CMath::Independent, CVectorCore< CType >::initialize(), mAllocatedSteps, mCompartment, mContainerValues, mKeys, mNumberToQuantityFactor, mNumVariables, COutputInterface::mObjects, CMatrix< C_FLOAT64 >::mpBuffer, mpEnd, mpIt, mPivot, mRecordedSteps, mTitles, CMath::ODE, CMatrix< CType >::resize(), CVector< CType >::resize(), CMatrix< C_FLOAT64 >::size(), and CMath::Time.
|
virtual |
Finish the output
Implements COutputInterface.
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
const | size_t & step |
const | size_t & variable |
References C_INVALID_INDEX, CMatrix< C_FLOAT64 >::mCols, mCompartment, mDummyFloat, mNumberToQuantityFactor, mNumVariables, CMatrix< C_FLOAT64 >::mpBuffer, mPivot, and mRecordedSteps.
Referenced by save().
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
const | size_t & step |
const | size_t & variable |
References CMatrix< C_FLOAT64 >::mCols, mDummyFloat, mNumVariables, CMatrix< C_FLOAT64 >::mpBuffer, mPivot, and mRecordedSteps.
Referenced by save().
const std::string & CTimeSeries::getKey | ( | const size_t & | variable | ) | const |
Retrieve the key of the model entity of the indexed variable (column)
const | size_t & variable |
References mDummyString, mKeys, mNumVariables, and mPivot.
Referenced by getSBMLId().
const size_t & CTimeSeries::getNumVariables | ( | ) | const |
Retrieve the number of variables (columns)
References mNumVariables.
Referenced by save().
const size_t & CTimeSeries::getRecordedSteps | ( | ) | const |
Retrieve the number of time steps (rows)
References mRecordedSteps.
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.
const | size_t & variable |
References CKeyFactory::get(), CDataModel::getCopasi2SBMLMap(), getKey(), CRootContainer::getKeyFactory(), and mDummyString.
const std::string & CTimeSeries::getTitle | ( | const size_t & | variable | ) | const |
Retrieve the title of the indexed variable (column)
const | size_t & variable |
References mDummyString, mNumVariables, mPivot, and mTitles.
Referenced by save().
void CTimeSeries::increaseAllocation | ( | ) |
Increase the allocated space for the time series.
References mAllocatedSteps, CMatrix< C_FLOAT64 >::mCols, CMatrix< C_FLOAT64 >::mpBuffer, mpEnd, mpIt, mRecordedSteps, CMatrix< CType >::resize(), and CMatrix< C_FLOAT64 >::size().
Referenced by output(), and separate().
|
private |
|
virtual |
Perform an output event for the current activity
const | Activity & activity |
Implements COutputInterface.
References CVectorCore< CType >::array(), C_FLOAT64, COutputInterface::DURING, increaseAllocation(), CMatrix< C_FLOAT64 >::mCols, mContainerValues, mpEnd, mpIt, and mRecordedSteps.
int CTimeSeries::save | ( | const std::string & | fileName, |
bool | writeParticleNumbers = false , |
||
const std::string & | separator = "\t" |
||
) | const |
Save the time series to a file
const | std::string & fileName |
bool | writeParticleNumbers (default: false) |
const | std::string& separator (default: "\t") |
References CLocaleString::fromUtf8().
Referenced by CTrajectoryProblem::printResult().
int CTimeSeries::save | ( | std::ostream & | str, |
bool | writeParticleNumbers = false , |
||
const std::string & | separator = "\t" |
||
) | const |
Save the time series to the given stream
str | the stream to write the series to |
bool | writeParticleNumbers (default: false) |
const | std::string& separator (default: "\t") |
References C_FLOAT64, getConcentrationData(), getData(), getNumVariables(), getTitle(), and mRecordedSteps.
|
virtual |
Introduce an additional separator into the output
const | Activity & activity |
Implements COutputInterface.
References C_FLOAT64, increaseAllocation(), CMatrix< C_FLOAT64 >::mCols, mpEnd, mpIt, and mRecordedSteps.
|
private |
The number of allocated steps
Referenced by allocate(), clear(), compile(), and increaseAllocation().
|
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().
|
private |
A reference to the values of the math container
Referenced by compile(), CTimeSeries(), and output().
|
staticprivate |
Static C_FLOAT64 0.0 for performance reasons
Referenced by getConcentrationData(), and getData().
|
staticprivate |
Static empty string for performance reasons
Referenced by getKey(), getSBMLId(), and getTitle().
|
private |
|
private |
Conversion factor needed for computing concentration data
Referenced by clear(), compile(), and getConcentrationData().
|
private |
The number of variables exposed
Referenced by clear(), compile(), getConcentrationData(), getData(), getKey(), getNumVariables(), and getTitle().
|
private |
Iterator pointing beyond the last allocated step (row)
Referenced by clear(), compile(), increaseAllocation(), output(), and separate().
|
private |
Iterator pointing the next step (row) to be recorded
Referenced by clear(), compile(), increaseAllocation(), output(), and separate().
|
private |
Pivot rearranging the columns to a more user friendly order
Referenced by clear(), compile(), getConcentrationData(), getData(), getKey(), and getTitle().
|
private |
The number of actually recorded steps
Referenced by clear(), compile(), getConcentrationData(), getData(), getRecordedSteps(), increaseAllocation(), output(), save(), and separate().
|
private |
Vector of column titles.
Referenced by clear(), compile(), and getTitle().