C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html
This commit is contained in:
parent
a0bca54c31
commit
33fc79540a
12
readme.txt
12
readme.txt
|
@ -2355,11 +2355,11 @@ default be assumed to have side-effects and hence will not participate
|
||||||
in constant folding optimisations.
|
in constant folding optimisations.
|
||||||
|
|
||||||
In the following example, a two input parameter free function named
|
In the following example, a two input parameter free function named
|
||||||
'compute', and a three input parameter lambda will be registered with
|
'compute1', and a three input parameter lambda named 'compute2' will
|
||||||
the given symbol_table instance:
|
be registered with the given symbol_table instance:
|
||||||
|
|
||||||
|
|
||||||
double compute(double v0, double v1)
|
double compute1(double v0, double v1)
|
||||||
{
|
{
|
||||||
return 2.0 * v0 + v1 / 3.0;
|
return 2.0 * v0 + v1 / 3.0;
|
||||||
}
|
}
|
||||||
|
@ -2372,13 +2372,13 @@ the given symbol_table instance:
|
||||||
|
|
||||||
symbol_table_t symbol_table;
|
symbol_table_t symbol_table;
|
||||||
|
|
||||||
symbol_table.add_function("compute", compute);
|
symbol_table.add_function("compute1", compute1);
|
||||||
|
|
||||||
symbol_table.add_function("lambda",
|
symbol_table.add_function(
|
||||||
|
"compute2",
|
||||||
[](double v0, double v1, double v2) -> double
|
[](double v0, double v1, double v2) -> double
|
||||||
{ return v0 / v1 + v2; });
|
{ return v0 / v1 + v2; });
|
||||||
|
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
[SECTION 16 - EXPRESSION DEPENDENTS]
|
[SECTION 16 - EXPRESSION DEPENDENTS]
|
||||||
|
|
Loading…
Reference in New Issue