15 #ifndef COPASI_CEvaluationNodeFunction
16 #define COPASI_CEvaluationNodeFunction
21 #ifdef WIN32 // These are not part of ANSI C and Visual C++ misses them.
22 static inline double asinh(
double value)
23 {
return log(value + sqrt(value * value + 1.0));}
25 static inline double acosh(
double value)
26 {
return log(value + sqrt(value * value - 1.0));}
28 static inline double atanh(
double value)
29 {
return (.5 * log((1.0 + value) / (1.0 - value)));}
31 static inline double round(
double value)
32 {
return value < 0.0 ? -floor(-value + 0.5) : floor(value + 0.5);}
157 virtual std::string
getInfix(
const std::vector< std::string > & children)
const;
163 virtual std::string
getDisplayString(
const std::vector< std::string > & children)
const;
169 virtual std::string
getCCodeString(
const std::vector< std::string > & children)
const;
183 virtual std::string
getXPPString(
const std::vector< std::string > & children)
const;
191 static CEvaluationNode *
fromAST(
const ASTNode * pASTNode,
const std::vector< CEvaluationNode * > & children);
219 virtual std::string
getMMLString(
const std::vector< std::string > & children,
221 const std::vector< std::vector< std::string > > & variables)
const;
227 std::string
handleSign(
const std::string & str)
const;
229 std::string
handleNot(
const std::string & str)
const;
232 {
return 1.0 / cos(value);}
235 {
return 1.0 / sin(value);}
238 {
return 1.0 / tan(value);}
241 {
return 1.0 / cosh(value);}
244 {
return 1.0 / sinh(value);}
247 {
return 1.0 / tanh(value);}
250 {
return acos(1.0 / value);}
253 {
return asin(1.0 / value);}
256 {
return atan(1.0 / value);}
259 {
return acosh(1.0 / value);}
262 {
return asinh(1.0 / value);}
265 {
return atanh(1.0 / value);}
270 value != ceil(value))
271 return std::numeric_limits<C_FLOAT64>::quiet_NaN();
274 return std::numeric_limits<C_FLOAT64>::infinity();
282 while (Value < value) Result *= ++Value;
294 {
return (value != 0.0) ? 0.0 : 1.0;}
333 #endif // COPASI_CEvaluationNodeFunction
static C_FLOAT64 factorial(C_FLOAT64 value)
virtual bool isBoolean() const
static C_FLOAT64 sech(C_FLOAT64 value)
static C_FLOAT64 min(const C_FLOAT64 &x1, const C_FLOAT64 &x2)
static C_FLOAT64 coth(C_FLOAT64 value)
std::string handleNot(const std::string &str) const
static C_FLOAT64 acsch(C_FLOAT64 value)
static C_FLOAT64 arccot(C_FLOAT64 value)
static C_FLOAT64 plus(C_FLOAT64 value)
C_FLOAT64(* mpFunction4)(const C_FLOAT64 &arg1, const C_FLOAT64 &arg2, const C_FLOAT64 &arg3, const C_FLOAT64 &arg4)
static CRandom * mpRandom
static C_FLOAT64 arcsec(C_FLOAT64 value)
virtual ~CEvaluationNodeFunction()
const C_FLOAT64 & getValue() const
static C_FLOAT64 rnormal(const C_FLOAT64 &mean, const C_FLOAT64 &sd)
virtual bool compile(const CEvaluationTree *pTree)
virtual std::string getBerkeleyMadonnaString(const std::vector< std::string > &children) const
static CEvaluationNode * fromAST(const ASTNode *pASTNode, const std::vector< CEvaluationNode * > &children)
C_FLOAT64(* mpFunction2)(const C_FLOAT64 &arg1, const C_FLOAT64 &arg2)
static C_FLOAT64 csch(C_FLOAT64 value)
virtual std::string getDisplayString(const std::vector< std::string > &children) const
CEvaluationNodeFunction()
static C_FLOAT64 copasiNot(C_FLOAT64 value)
virtual std::string getCCodeString(const std::vector< std::string > &children) const
virtual std::string getXPPString(const std::vector< std::string > &children) const
static C_FLOAT64 asech(C_FLOAT64 value)
C_FLOAT64(* mpFunction)(C_FLOAT64 arg1)
static C_FLOAT64 sec(C_FLOAT64 value)
virtual CEvaluationNode * simplifyNode(const std::vector< CEvaluationNode * > &children) const
static C_FLOAT64 runiform(const C_FLOAT64 &lowerBound, const C_FLOAT64 &upperBound)
static C_FLOAT64 csc(C_FLOAT64 value)
static C_FLOAT64 rgamma(const C_FLOAT64 &shape, const C_FLOAT64 &scale)
static C_FLOAT64 rpoisson(const C_FLOAT64 mu)
static C_FLOAT64 arccsc(C_FLOAT64 value)
virtual ASTNode * toAST(const CCopasiDataModel *pDataModel) const
static Type subType(const Type &type)
static C_FLOAT64 max(const C_FLOAT64 &x1, const C_FLOAT64 &x2)
static C_FLOAT64 cot(C_FLOAT64 value)
static C_FLOAT64 acoth(C_FLOAT64 value)
virtual std::string getInfix(const std::vector< std::string > &children) const
virtual std::string getMMLString(const std::vector< std::string > &children, bool expand, const std::vector< std::vector< std::string > > &variables) const
static C_FLOAT64 minus(C_FLOAT64 value)
CEvaluationNode * getLeft()
std::string handleSign(const std::string &str) const