C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow
2015-04-28 16:50:54 +10:00
parent e39ec67df9
commit 85c094a1aa
6 changed files with 364 additions and 221 deletions

View File

@ -28,11 +28,14 @@ void fibonacci()
typedef exprtk::expression<T> expression_t;
typedef exprtk::parser<T> parser_t;
typedef exprtk::function_compositor<T> compositor_t;
typedef typename compositor_t::function function_t;
compositor_t compositor;
compositor
.add("fibonacci",
.add(
function_t(
"fibonacci",
" var w := 0; "
" var y := 0; "
" var z := 1; "
@ -49,7 +52,7 @@ void fibonacci()
" z "
" }; "
" } ",
"x");
"x"));
T x = T(0);