![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Mathematical expression parser and evaluator. More...
#include <string>#include <vector>#include <functional>Go to the source code of this file.
Classes | |
| struct | openswmm::mathexpr::Token |
| struct | openswmm::mathexpr::Expression |
Namespaces | |
| namespace | openswmm |
| namespace | openswmm::mathexpr |
Functions | |
| int | openswmm::mathexpr::parse (const std::string &expr_str, Expression &result) |
| Parse an infix expression string into a postfix Expression. | |
| int | openswmm::mathexpr::bind_variables (Expression &expr, const char *const *name_table, int n_vars) |
| Bind variable names in a compiled expression to integer indices. | |
| int | openswmm::mathexpr::compute_max_stack_depth (const Expression &expr) |
| Compute the maximum stack depth needed to evaluate an expression. | |
| double | openswmm::mathexpr::evaluate (const Expression &expr, const std::function< double(const std::string &)> &var_lookup) |
| Evaluate a compiled expression with named variable lookup. | |
| double | openswmm::mathexpr::evaluate (const Expression &expr, const double *vars, int n_vars) |
| Evaluate with a flat variable array (by index). | |
| double | openswmm::mathexpr::evaluate_fast (const Expression &expr, const double *vars) noexcept |
| Fast evaluate using pre-bound variable indices and stack-free evaluation. | |
Mathematical expression parser and evaluator.
Parses infix expressions (e.g., "C * exp(-0.1 * DT)") into postfix (RPN) token lists using the Shunting-yard algorithm. Evaluation uses a simple stack machine.
Used by: