COPASI API
4.16.103
|
#include <CSBMLunit.h>
Classes | |
class | SymbolicExponent |
this class uniquely (in a given context) identifies a symbol More... | |
Public Member Functions | |
void | applyExponent (double exp) |
apply numeric exponent to the unit. More... | |
void | applyExponent (const std::string &id, size_t frame) |
apply symbolic exponent to the unit More... | |
void | applyInverseExponent (const std::string &id, size_t frame) |
apply inverse of symbolic exponent to the unit More... | |
CSBMLunit (unsigned int sbmlLevel, unsigned int sbmlVersion) | |
Default constructor. More... | |
CSBMLunit (const CSBMLunit &src) | |
Copy constructor. More... | |
CSBMLunit (const UnitDefinition *ud) | |
Constructor from libsbml units. More... | |
virtual std::string | getDisplayString () const |
UnitDefinition & | getSBMLUnitDefinition () |
const UnitDefinition & | getSBMLUnitDefinition () const |
int | getSymbolicExpExp () const |
const std::string & | getSymbolicExponent () const |
void | invert () |
bool | isDimensionless () const |
bool | multiply (const CSBMLunit &unit) |
virtual | ~CSBMLunit () |
Static Public Member Functions | |
static bool | isEqual (const CSBMLunit &unit1, const CSBMLunit &unit2) |
Private Attributes | |
SymbolicExponent | mSymExp |
int | mSymExpExp |
UnitDefinition | mUD |
The current implementation of the units is just a wrapper for the libsbml UnitDefinition class.
Definition at line 21 of file CSBMLunit.h.
CSBMLunit::CSBMLunit | ( | unsigned int | sbmlLevel, |
unsigned int | sbmlVersion | ||
) |
CSBMLunit::CSBMLunit | ( | const CSBMLunit & | src | ) |
CSBMLunit::CSBMLunit | ( | const UnitDefinition * | ud | ) |
|
virtual |
Definition at line 40 of file CSBMLunit.cpp.
void CSBMLunit::applyExponent | ( | double | exp | ) |
apply numeric exponent to the unit.
The current implementation only supports integer exponents.
Definition at line 104 of file CSBMLunit.cpp.
References isDimensionless(), mSymExpExp, and mUD.
Referenced by CSBMLunitInterface::recursionPower().
void CSBMLunit::applyExponent | ( | const std::string & | id, |
size_t | frame | ||
) |
apply symbolic exponent to the unit
This method applies a symbol as an exponent to the unit. The result is not really a valid unit itself, but the exponent can cancel out later during the calculations (via applyInverseExponent() ). In the current implementation, a string and an integer (sbml id + frame stack index) are sufficient to uniquely identify a symbol within one expression. In other words: Once we know the frame index the ID is unique.
Definition at line 122 of file CSBMLunit.cpp.
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, and mSymExpExp.
void CSBMLunit::applyInverseExponent | ( | const std::string & | id, |
size_t | frame | ||
) |
apply inverse of symbolic exponent to the unit
This method applies a symbol as a reverse exponent to the unit. The result is not really a valid unit itself, but the exponent can cancel out later. See applyExponent(std::string id, int frame)
Definition at line 140 of file CSBMLunit.cpp.
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, and mSymExpExp.
Referenced by CSBMLunitInterface::recursionPower().
|
virtual |
Reimplemented in CSBMLunitInformation.
Definition at line 44 of file CSBMLunit.cpp.
References CSBMLunit::SymbolicExponent::mID, mSymExp, mSymExpExp, and mUD.
Referenced by CSBMLunitInformation::getDisplayString().
|
inline |
Definition at line 69 of file CSBMLunit.h.
References mUD.
Referenced by Expression2PresentationMMLUnits::getMathML(), and CSBMLunitInterface::writeBackToModel().
|
inline |
|
inline |
Definition at line 72 of file CSBMLunit.h.
References mSymExpExp.
Referenced by Expression2PresentationMMLUnits::getMathML(), and CSBMLunitInterface::writeBackToModel().
|
inline |
Definition at line 73 of file CSBMLunit.h.
Referenced by Expression2PresentationMMLUnits::getMathML().
void CSBMLunit::invert | ( | ) |
Definition at line 88 of file CSBMLunit.cpp.
References isDimensionless(), mSymExpExp, and mUD.
Referenced by CSBMLunitInterface::handleOneExpression(), CSBMLunitInterface::initializeFromSBMLModel(), CSBMLunitInterface::recursionDivide(), and CSBMLunitInterface::recursionTimes().
bool CSBMLunit::isDimensionless | ( | ) | const |
Definition at line 175 of file CSBMLunit.cpp.
References mUD.
Referenced by applyExponent(), applyInverseExponent(), invert(), isEqual(), and multiply().
Definition at line 159 of file CSBMLunit.cpp.
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, mSymExpExp, and mUD.
Referenced by CSBMLunitInterface::handleTerminalNode(), and CSBMLunitInformation::isEqual().
bool CSBMLunit::multiply | ( | const CSBMLunit & | unit | ) |
Definition at line 60 of file CSBMLunit.cpp.
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, mSymExpExp, and mUD.
Referenced by CSBMLunitInterface::handleOneExpression(), CSBMLunitInterface::initializeFromSBMLModel(), CSBMLunitInterface::recursionDivide(), and CSBMLunitInterface::recursionTimes().
|
private |
Definition at line 90 of file CSBMLunit.h.
Referenced by applyExponent(), applyInverseExponent(), getDisplayString(), isEqual(), and multiply().
|
private |
Definition at line 91 of file CSBMLunit.h.
Referenced by applyExponent(), applyInverseExponent(), getDisplayString(), getSymbolicExpExp(), invert(), isEqual(), and multiply().
|
private |
Definition at line 73 of file CSBMLunit.h.
Referenced by applyExponent(), CSBMLunit(), getDisplayString(), getSBMLUnitDefinition(), invert(), isDimensionless(), isEqual(), and multiply().