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

This commit is contained in:
Arash Partow 2016-10-05 13:33:35 +11:00
parent a5d224e537
commit 3a82d4af1b
3 changed files with 2 additions and 3 deletions

View File

@ -28,7 +28,7 @@ struct myfunc : public exprtk::ifunction<T>
myfunc() myfunc()
: exprtk::ifunction<T>(2) : exprtk::ifunction<T>(2)
{} { exprtk::disable_has_side_effects(*this); }
inline T operator()(const T& v1, const T& v2) inline T operator()(const T& v1, const T& v2)
{ {

View File

@ -47,7 +47,7 @@ void bubble_sort()
" upper_bound -= 1; " " upper_bound -= 1; "
" until (not(swapped) or (upper_bound == 0)); "; " until (not(swapped) or (upper_bound == 0)); ";
T v[] = { T(2.2), T(1.1), T(5.5), T(4.4), T(3.3) }; T v[] = { T(9.9), T(2.2), T(1.1), T(5.5), T(7.7), T(4.4), T(3.3) };
symbol_table_t symbol_table; symbol_table_t symbol_table;
symbol_table.add_vector("v",v); symbol_table.add_vector("v",v);

View File

@ -61,7 +61,6 @@ void black_scholes_merton_model()
expression.register_symbol_table(symbol_table); expression.register_symbol_table(symbol_table);
parser_t parser; parser_t parser;
parser.compile(bsm_model_program,expression); parser.compile(bsm_model_program,expression);
{ {