COPASI API
4.40.278
|
#include <CSBMLunit.h>
Classes | |
class | SymbolicExponent |
this class uniquely (in a given context) identifies a symbol More... | |
Public Member Functions | |
void | applyExponent (const std::string &id, size_t frame) |
apply symbolic exponent to the unit More... | |
void | applyExponent (double exp) |
apply numeric exponent to the unit. More... | |
void | applyInverseExponent (const std::string &id, size_t frame) |
apply inverse of symbolic exponent to the unit More... | |
CSBMLunit (const CSBMLunit &src) | |
Copy constructor. More... | |
CSBMLunit (const UnitDefinition *ud) | |
Constructor from libsbml units. More... | |
CSBMLunit (unsigned int sbmlLevel, unsigned int sbmlVersion) | |
Default constructor. 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.
CSBMLunit::CSBMLunit | ( | unsigned int | sbmlLevel, |
unsigned int | sbmlVersion | ||
) |
Default constructor.
References mUD.
CSBMLunit::CSBMLunit | ( | const CSBMLunit & | src | ) |
Copy constructor.
CSBMLunit::CSBMLunit | ( | const UnitDefinition * | ud | ) |
Constructor from libsbml units.
|
virtual |
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.
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, and mSymExpExp.
void CSBMLunit::applyExponent | ( | double | exp | ) |
apply numeric exponent to the unit.
The current implementation only supports integer exponents.
References isDimensionless(), mSymExpExp, and mUD.
Referenced by CSBMLunitInterface::recursionPower().
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)
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, and mSymExpExp.
Referenced by CSBMLunitInterface::recursionPower().
|
virtual |
Reimplemented in CSBMLunitInformation.
References CSBMLunit::SymbolicExponent::mID, mSymExp, mSymExpExp, and mUD.
Referenced by CSBMLunitInformation::getDisplayString().
|
inline |
References mUD.
Referenced by Expression2PresentationMMLUnits::getMathML(), and CSBMLunitInterface::writeBackToModel().
|
inline |
References mUD.
|
inline |
References mSymExpExp.
Referenced by Expression2PresentationMMLUnits::getMathML(), and CSBMLunitInterface::writeBackToModel().
|
inline |
References CSBMLunit::SymbolicExponent::mID, and mSymExp.
Referenced by Expression2PresentationMMLUnits::getMathML().
void CSBMLunit::invert | ( | ) |
bool CSBMLunit::isDimensionless | ( | ) | const |
References mUD.
Referenced by applyExponent(), applyInverseExponent(), invert(), isEqual(), and multiply().
References isDimensionless(), CSBMLunit::SymbolicExponent::isEqual(), mSymExp, mSymExpExp, and mUD.
Referenced by CSBMLunitInterface::handleTerminalNode(), and CSBMLunitInformation::isEqual().
bool CSBMLunit::multiply | ( | const CSBMLunit & | unit | ) |
|
private |
Referenced by applyExponent(), applyInverseExponent(), getDisplayString(), getSymbolicExponent(), isEqual(), and multiply().
|
private |
Referenced by applyExponent(), applyInverseExponent(), getDisplayString(), getSymbolicExpExp(), invert(), isEqual(), and multiply().
|
private |
Referenced by applyExponent(), CSBMLunit(), getDisplayString(), getSBMLUnitDefinition(), invert(), isDimensionless(), isEqual(), and multiply().