Go to the documentation of this file.
44 const std::string&
name()
const;
74 void getErrors(std::vector<std::string>& errors)
const;
const char * evalStr(ExprEvalHandle eeh)
const Context & context() const
DExpression(const std::string &varName, Expressions &context, const std::string &e, const ExprType &type=ExprType().FP(3), EvaluationStrategy be=defaultEvaluationStrategy)
void setVariable(VariableHandle handle, double value)
ExprEvalHandle getExprEvalHandle(ExprHandle eh)
void setLoopVariable(VariableSetHandle handle, double value)
std::pair< ExprHandle, std::vector< DExpression * > > ExprEvalHandle
std::set< GlobalVal * > operandVars
void getErrors(std::vector< std::string > &errors) const
const std::vector< double > & evalFP(ExprEvalHandle eeh)
std::set< GlobalVal * >::iterator VariableHandle
ExprVarRef * resolveVar(const std::string &name) const
VariableSetHandle getLoopVarSetHandle(VariableHandle vh)
std::set< DExpression * > operandExprs
const std::string & name() const
std::set< DExpression * > AllExprs
void setVariable(VariableHandle handle, double *values, unsigned dim)
< b ></b >< br >< b ></b ></td >< td > vector constructor< br > vector component access n must be
For any rgb or hsl value(except for negative s values)
VariableHandle addExternalVariable(const std::string &variableName, ExprType seTy)
std::set< DExpression * >::iterator ExprHandle
std::set< GlobalVal * > AllExternalVars
EvaluationStrategy
Types of evaluation strategies that are available.
std::set< DExpression * > exprEvaled
static EvaluationStrategy defaultEvaluationStrategy
What evaluation strategy to use by default.
std::set< DExpression * > exprToEval
ExprHandle addExpression(const std::string &varName, ExprType seTy, const std::string &expr)
std::set< GlobalVal * >::iterator VariableSetHandle
void setLoopVariable(VariableSetHandle handle, double *values, unsigned dim)
abstract class for implementing variable references
</pre >< h3 > Binding our variable reference</h3 > If we now tried to use the variable would still not be found by our expressions To make it bindable we need to override the resolveVar() function as follows</pre >< h3 > Variable setting</h3 > Next we need to make a way of setting the variable As the controlling code will use the expression it will repeatedly alternate between setting the independent variables that are used and calling evaluate(). What it has to do depends very much on the application. In this case we only need to set the independent variable x as</pre >< h2 > Evaluating expressions</h2 > Evaluating an expression is pretty easy But before we can do that we need to make an instance< pre > GrapherExpr expr("x+x^2")