Main MRPT website > C++ reference for MRPT 1.9.9
CRuntimeCompiledExpression_unittest.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
11 #include <mrpt/utils/CTraitsTest.h>
12 #include <gtest/gtest.h>
13 
15 
16 using namespace mrpt;
17 using namespace mrpt::utils;
18 using namespace mrpt::math;
19 using namespace std;
20 
21 TEST(RuntimeCompiledExpression, SimpleTest)
22 {
23  mrpt::math::CRuntimeCompiledExpression expr;
24  std::map<std::string, double> vars;
25 
26  vars["x"] = 5.0;
27  vars["y"] = 3.0;
28  expr.compile("x^2+x*y+1", vars);
29 
30  EXPECT_NEAR(
31  expr.eval(), vars["x"] * vars["x"] + vars["x"] * vars["y"] + 1.0, 1e-9);
32 }
TEST(RuntimeCompiledExpression, SimpleTest)
This base provides a set of functions for maths stuff.
Definition: CArrayNumeric.h:20
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values,...
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.



Page generated by Doxygen 1.9.1 for MRPT 1.9.9 Git: 63ea9d1f1 Thu Nov 23 00:06:53 2017 +0100 at mar 26 may 2026 12:19:29 CEST