11 #include <CTraitsTest.h> 12 #include <gtest/gtest.h> 14 template class mrpt::CTraitsTest<mrpt::expr::CRuntimeCompiledExpression>;
16 TEST(RuntimeCompiledExpression, SimpleTest)
19 std::map<std::string, double> vars;
23 expr.
compile(
"x^2+x*y+1", vars);
26 expr.
eval(), vars[
"x"] * vars[
"x"] + vars[
"x"] * vars[
"y"] + 1.0, 1e-9);
A wrapper of exprtk runtime expression compiler: it takes a string representing an expression (from a...
TEST(RuntimeCompiledExpression, SimpleTest)
void compile(const std::string &expression, const std::map< std::string, double > &variables=std::map< std::string, double >(), const std::string &expr_name_for_error_reporting=std::string())
Initializes the object by compiling an expression.
double eval() const
Evaluates the current value of the precompiled formula.