COPASI API  4.40.278
CSBMLunit Class Reference

#include <CSBMLunit.h>

Inheritance diagram for CSBMLunit:
[legend]

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
 

Detailed Description

The current implementation of the units is just a wrapper for the libsbml UnitDefinition class.

Constructor & Destructor Documentation

◆ CSBMLunit() [1/3]

CSBMLunit::CSBMLunit ( unsigned int  sbmlLevel,
unsigned int  sbmlVersion 
)

Default constructor.

References mUD.

◆ CSBMLunit() [2/3]

CSBMLunit::CSBMLunit ( const CSBMLunit src)

Copy constructor.

◆ CSBMLunit() [3/3]

CSBMLunit::CSBMLunit ( const UnitDefinition *  ud)

Constructor from libsbml units.

◆ ~CSBMLunit()

CSBMLunit::~CSBMLunit ( )
virtual

Member Function Documentation

◆ applyExponent() [1/2]

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.

◆ applyExponent() [2/2]

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().

◆ applyInverseExponent()

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().

◆ getDisplayString()

std::string CSBMLunit::getDisplayString ( ) const
virtual

◆ getSBMLUnitDefinition() [1/2]

UnitDefinition& CSBMLunit::getSBMLUnitDefinition ( )
inline

◆ getSBMLUnitDefinition() [2/2]

const UnitDefinition& CSBMLunit::getSBMLUnitDefinition ( ) const
inline

References mUD.

◆ getSymbolicExpExp()

int CSBMLunit::getSymbolicExpExp ( ) const
inline

◆ getSymbolicExponent()

const std::string& CSBMLunit::getSymbolicExponent ( ) const
inline

◆ invert()

◆ isDimensionless()

bool CSBMLunit::isDimensionless ( ) const

◆ isEqual()

bool CSBMLunit::isEqual ( const CSBMLunit unit1,
const CSBMLunit unit2 
)
static

◆ multiply()

Member Data Documentation

◆ mSymExp

◆ mSymExpExp

◆ mUD


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