From 654bf59c367214377498f7fbaf28167ef9ce0811 Mon Sep 17 00:00:00 2001 From: Arash Partow Date: Sat, 7 May 2016 18:23:27 +1000 Subject: [PATCH] C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html --- exprtk.hpp | 13 ++++++++----- readme.txt | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/exprtk.hpp b/exprtk.hpp index 17bb65b..fffffc2 100644 --- a/exprtk.hpp +++ b/exprtk.hpp @@ -2892,10 +2892,12 @@ namespace exprtk { token t; - while (join(g.token_list_[i],g.token_list_[i + 1],t)) + while (join(g[i],g[i + 1],t)) { g.token_list_[i] = t; + g.token_list_.erase(g.token_list_.begin() + (i + 1)); + ++changes; } } @@ -2914,9 +2916,10 @@ namespace exprtk { token t; - while (join(g.token_list_[i],g.token_list_[i + 1],g.token_list_[i + 2],t)) + while (join(g[i],g[i + 1],g[i + 2],t)) { g.token_list_[i] = t; + g.token_list_.erase(g.token_list_.begin() + (i + 1), g.token_list_.begin() + (i + 3)); ++changes; @@ -33721,9 +33724,9 @@ namespace exprtk namespace information { static const char* library = "Mathematical Expression Toolkit"; - static const char* version = "2.71828182845904523536028747135266" - "2497757247093699959574966967627724"; - static const char* date = "20160113"; + static const char* version = "2.718281828459045235360287471352662" + "49775724709369995957496696762772407"; + static const char* date = "20160606"; static inline std::string data() { diff --git a/readme.txt b/readme.txt index 04cb5cd..badb629 100644 --- a/readme.txt +++ b/readme.txt @@ -1639,11 +1639,11 @@ expression, an instance of each function needs to be registered with a symbol_table that has been associated with the expression instance. The following demonstrates how all the pieces are put together: - typedef exprtk::symbol_table symbol_table_t; - typedef exprtk::expression expression_t; - typedef exprtk::parser parser_t; - typedef exprtk::function_compositor compositor_t; - typedef typename compositor_t::function function_t; + typedef exprtk::symbol_table symbol_table_t; + typedef exprtk::expression expression_t; + typedef exprtk::parser parser_t; + typedef exprtk::function_compositor compositor_t; + typedef typename compositor_t::function function_t; foo f; boo b;