11 #include <gtest/gtest.h> 18 TEST(RuntimeCompiledExpression,SimpleTest)
21 std::map<std::string, double> vars;
25 expr.
compile(
"x^2+x*y+1", vars);
27 EXPECT_NEAR(expr.
eval(), vars[
"x"] * vars[
"x"] + vars[
"x"] * vars[
"y"] + 1.0, 1e-9);
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
A wrapper of exprtk runtime expression compiler: it takes a string representing an expression (from a...
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.
This base provides a set of functions for maths stuff.
double eval() const
Evaluates the current value of the precompiled formula.
TEST(RuntimeCompiledExpression, SimpleTest)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.