copasi API  0.1
Public Member Functions | Protected Member Functions | Friends
CFunction Class Reference

The class for handling a chemical kinetic function. More...

#include <CFunction.h>

Inheritance diagram for CFunction:
CEvaluationTree CCopasiContainer CAnnotation CCopasiObject CKinFunction CMassAction

List of all members.

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 TriLogicisReversible () const
CFunctionParametersgetVariables ()
const CFunctionParametersgetVariables () 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)
CFunctioncreateCopy () 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)

Detailed Description

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.


Constructor & Destructor Documentation

CFunction::CFunction ( const std::string &  name = "NoName",
const CCopasiContainer pParent = NULL,
const Type type = Function 
)

Default constructor

Parameters:
conststd::string & name (default: "NoName")
constCEvaluationTree::Type & type (default: Function)
constCCopasiContainer * pParent (default: NULL)
CFunction::CFunction ( const CFunction src,
const CCopasiContainer pParent = NULL 
)

Copy constructor

Parameters:
constCFunction & src
constCCopasiContainer * pParent (default: NULL)
CFunction::~CFunction ( ) [virtual]

Destructor


Member Function Documentation

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.

Parameters:
conststring & name
conststring & usage (Default: VARIABLE)
constCFunctionParameters::DataType & type (Default: value)
Returns:
bool success
const C_FLOAT64 & CFunction::calcValue ( const CCallParameters< C_FLOAT64 > &  callParameters) [virtual]

Function to calculate the value of the function

Parameters:
constCCallParameters<C_FLOAT64> & callParameters
Returns:
const C_FLOAT64 & result

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.

Parameters:
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

Parameters:
constvoid * parameter
constCCallParameters<C_FLOAT64> & callParameters
booldependsOn

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.

Parameters:
conststd::string & name
Returns:
unsigned C_INT32 index

Reimplemented from CEvaluationTree.

CFunctionParameters & CFunction::getVariables ( )

Function to retrive the definition of the parameters

Returns:
CFunctionParameters & variables
const CFunctionParameters & CFunction::getVariables ( ) const

Function to retrive the definition of the parameters

Returns:
const CFunctionParameters & variables
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.

Parameters:
constunsigned C_INT32 & index
Returns:
const C_FLOAT64 & variableValue

Reimplemented from CEvaluationTree.

bool CFunction::initVariables ( ) [protected]

Function to initialize the parameters

Returns:
bool success
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)

Parameters:
CReadConfig &configBuffer
CReadConfig::Modemode (default: CReadConfig::SEARCH)
Returns:
Fail
bool CFunction::setInfix ( const std::string &  infix) [virtual]

Function to set the infix description of the tree and compile it.

Parameters:
conststd::string & infix
Returns:
bool success

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

Parameters:
constCEvaluationNode* node
conststd::string & name1
conststd::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.

Parameters:
std::ostream& out
unsignedC_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.

Parameters:
std::ostream& out
conststd::vector<std::vector<std::string> > & env
boolexpand = true
boolfullExpand
unsignedC_INT32 l

Reimplemented in CMassAction.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const CFunction f 
) [friend]

Insert operator


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines