Go to the documentation of this file.
38 #ifndef __SIM_MATHEXPR_HH__
39 #define __SIM_MATHEXPR_HH__
93 typedef double (*
binOp)(double, double);
103 std::array<OpSearch, uNeg + 1>
ops;
109 const char opStr[] = {
'+',
'-',
'*',
'/',
'^',
'-'};
118 return std::string(1, opStr[
op]);
135 std::string
toStr(
Node *
n, std::string prefix)
const;
const std::string to_string(sc_enc enc)
MathExpr(std::string expr)
std::vector< std::string > getVariables() const
Return all variables in the this expression.
Node * parse(std::string expr)
Parse and create nodes from string.
std::string toStr() const
Prints an ASCII representation of the expression tree.
std::string toStr() const
double(* binOp)(double, double)
std::array< OpSearch, uNeg+1 > ops
Operator list.
double eval(EvalCallback fn) const
Evaluates the expression.
std::function< double(std::string)> EvalCallback
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17