copasi API
0.1
|
The class for handling a chemical kinetic function. More...
#include <CFunction.h>
Public Member Functions | |
CFunction (const std::string &name="NoName", const CCopasiContainer *pParent=NULL, const Type &type=Function) | |
CFunction (const CFunction &src, const CCopasiContainer *pParent=NULL) | |
virtual | ~CFunction () |
virtual bool | setInfix (const std::string &infix) |
virtual const C_FLOAT64 & | calcValue (const CCallParameters< C_FLOAT64 > &callParameters) |
virtual bool | dependsOn (const C_FLOAT64 *parameter, const CCallParameters< C_FLOAT64 > &callParameters) const |
virtual unsigned C_INT32 | getVariableIndex (const std::string &name) const |
virtual const C_FLOAT64 & | getVariableValue (const unsigned C_INT32 &index) const |
void | setReversible (const TriLogic &reversible) |
const TriLogic & | isReversible () const |
CFunctionParameters & | getVariables () |
const CFunctionParameters & | getVariables () const |
bool | addVariable (const std::string &name, CFunctionParameter::Role usage=CFunctionParameter::VARIABLE, const CFunctionParameter::DataType &type=CFunctionParameter::FLOAT64) |
virtual void | load (CReadConfig &configBuffer, CReadConfig::Mode mode=CReadConfig::SEARCH) |
bool | isSuitable (const unsigned C_INT32 noSubstrates, const unsigned C_INT32 noProducts, const TriLogic reversible) |
virtual void | writeMathML (std::ostream &out, unsigned C_INT32 l=0) const |
virtual void | writeMathML (std::ostream &out, const std::vector< std::vector< std::string > > &env, bool expand=true, bool fullExpand=true, unsigned C_INT32 l=0) const |
void | createListOfParametersForMathML (std::vector< std::vector< std::string > > &env) |
CFunction * | createCopy () const |
std::pair< CFunction *, CFunction * > | splitFunction (const CEvaluationNode *node, const std::string &name1, const std::string &name2) const |
Protected Member Functions | |
bool | initVariables () |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CFunction &f) |
The class for handling a chemical kinetic function.
This class is designed to handle all about a given chemical kinetic function from editing and displaying (with help of MathML) the function to calculating the function value.
CFunction::CFunction | ( | const std::string & | name = "NoName" , |
const CCopasiContainer * | pParent = NULL , |
||
const Type & | type = Function |
||
) |
Default constructor
const | std::string & name (default: "NoName") |
const | CEvaluationTree::Type & type (default: Function) |
const | CCopasiContainer * pParent (default: NULL) |
CFunction::CFunction | ( | const CFunction & | src, |
const CCopasiContainer * | pParent = NULL |
||
) |
Copy constructor
const | CFunction & src |
const | CCopasiContainer * pParent (default: NULL) |
CFunction::~CFunction | ( | ) | [virtual] |
Destructor
bool CFunction::addVariable | ( | const std::string & | name, |
CFunctionParameter::Role | usage = CFunctionParameter::VARIABLE , |
||
const CFunctionParameter::DataType & | type = CFunctionParameter::FLOAT64 |
||
) |
Function to add the description of a variable.
const | string & name |
const | string & usage (Default: VARIABLE) |
const | CFunctionParameters::DataType & type (Default: value) |
const C_FLOAT64 & CFunction::calcValue | ( | const CCallParameters< C_FLOAT64 > & | callParameters | ) | [virtual] |
Function to calculate the value of the function
const | CCallParameters<C_FLOAT64> & callParameters |
Reimplemented in CMassAction.
CFunction * CFunction::createCopy | ( | ) | const |
Function to duplicate itself
void CFunction::createListOfParametersForMathML | ( | std::vector< std::vector< std::string > > & | env | ) |
Function to create a list of the names of the function parameters in MathML format. This list can be passed as the env argument to the writeMathML() method.
std::vector<std::vector<std::string> | > & env |
bool CFunction::dependsOn | ( | const C_FLOAT64 * | parameter, |
const CCallParameters< C_FLOAT64 > & | callParameters | ||
) | const [virtual] |
Function to return whether it depends on the given parameter
const | void * parameter |
const | CCallParameters<C_FLOAT64> & callParameters |
bool | dependsOn |
Reimplemented in CMassAction.
unsigned C_INT32 CFunction::getVariableIndex | ( | const std::string & | name | ) | const [virtual] |
Function to retrieve the index to the value of the named variable.
const | std::string & name |
Reimplemented from CEvaluationTree.
CFunctionParameters & CFunction::getVariables | ( | ) |
Function to retrive the definition of the parameters
const CFunctionParameters & CFunction::getVariables | ( | ) | const |
Function to retrive the definition of the parameters
const C_FLOAT64 & CFunction::getVariableValue | ( | const unsigned C_INT32 & | index | ) | const [virtual] |
Function to retrieve the value of the indexed variable.
Note this function is only usable during calcValue, since the values of the call parameters are only defined during that time.
const | unsigned C_INT32 & index |
Reimplemented from CEvaluationTree.
bool CFunction::initVariables | ( | ) | [protected] |
Function to initialize the parameters
const TriLogic & CFunction::isReversible | ( | ) | const |
Function to retrieve whether it is reversible.
bool CFunction::isSuitable | ( | const unsigned C_INT32 | noSubstrates, |
const unsigned C_INT32 | noProducts, | ||
const TriLogic | reversible | ||
) |
Function to determine whether it is suitable for a reaction with the given number of substrates and products and reversibility
void CFunction::load | ( | CReadConfig & | configBuffer, |
CReadConfig::Mode | mode = CReadConfig::SEARCH |
||
) | [virtual] |
Function to load an object with data coming from a CReadConfig object. (CReadConfig object reads an input stream)
CReadConfig & | configBuffer |
CReadConfig::Mode | mode (default: CReadConfig::SEARCH) |
bool CFunction::setInfix | ( | const std::string & | infix | ) | [virtual] |
Function to set the infix description of the tree and compile it.
const | std::string & infix |
Reimplemented from CEvaluationTree.
Reimplemented in CMassAction.
void CFunction::setReversible | ( | const TriLogic & | reversible | ) |
Function to set whether it is reversible.
std::pair< CFunction *, CFunction * > CFunction::splitFunction | ( | const CEvaluationNode * | node, |
const std::string & | name1, | ||
const std::string & | name2 | ||
) | const |
Function to split
const | CEvaluationNode* node |
const | std::string & name1 |
const | std::string & name2 |
void CFunction::writeMathML | ( | std::ostream & | out, |
unsigned C_INT32 | l = 0 |
||
) | const [virtual] |
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
std::ostream | & out |
unsigned | C_INT32 l |
void CFunction::writeMathML | ( | std::ostream & | out, |
const std::vector< std::vector< std::string > > & | env, | ||
bool | expand = true , |
||
bool | fullExpand = true , |
||
unsigned C_INT32 | l = 0 |
||
) | const [virtual] |
Function to write the mathematical formula in format of MathML.
std::ostream | & out |
const | std::vector<std::vector<std::string> > & env |
bool | expand = true |
bool | fullExpand |
unsigned | C_INT32 l |
Reimplemented in CMassAction.
std::ostream& operator<< | ( | std::ostream & | os, |
const CFunction & | f | ||
) | [friend] |
Insert operator