Class Dune::XT::Functions::internal::MathExpressionEngine¶
-
class Dune::XT::Functions::internal::MathExpressionEngine¶
Parses and evaluates mathematical expression strings that depend on named variables. This is a thin, deliberately non-templated wrapper around the third-party ExprTk parser. By operating on \c double only, the heavy ExprTk header stays confined to a single translation unit (engine.cc), hidden behind a pimpl. The templated MathExpressionBase / DynamicMathExpressionBase wrappers convert their field types to/from \c double and delegate the actual parsing and evaluation here. Supported operators and functions mirror the previously bundled parser: \c + \c - \c * \c / \c ^,
Note
Implicit multiplication by juxtaposition is supported, e.g. “x[0]t” means “x[0]*t”, “x[0]2” means “x[0]2” and “sin(t)(x)” means “sin(t)(x)”. An explicit \c * is still recommended for readability.
Class Dune::XT::Functions::internal::MathExpressionEngine::Impl¶
-
class Dune::XT::Functions::internal::MathExpressionEngine::Impl¶
No documentation provided.
-
MathExpressionEngine &Dune::XT::Functions::internal::MathExpressionEngine::operator=(const MathExpressionEngine&) = delete¶
No documentation provided.
-
const int &Dune::XT::Functions::internal::MathExpressionEngine::variables() const¶
No documentation provided.
-
const int &Dune::XT::Functions::internal::MathExpressionEngine::expressions() const¶
No documentation provided.
-
void Dune::XT::Functions::internal::MathExpressionEngine::evaluate(const double *values, std::size_t num_values, double *results, std::size_t num_results) const¶
Evaluate all expressions for the given variable values.
values holds one entry per variable (in the order given to the constructor) and results one entry per expression.
Note
Not thread-safe: callers must serialize access (the wrappers hold a mutex), matching the behavior of the previously bundled parser.
-
Dune::XT::Functions::internal::MathExpressionEngine::MathExpressionEngine(int variables, int expressions)¶
Parse \a expressions, each depending on the given named \a variables. Variable names may contain a bracketed integer index (e.g. “x[0]”, “mu[1]”) or a trailing underscore (e.g. “t_”), neither of which ExprTk accepts as an identifier; they are transparently remapped to internal placeholder identifiers before compilation.
:throws Common::Exceptions::wrong_input_given: if an expression cannot be parsed.
-
Dune::XT::Functions::internal::MathExpressionEngine::MathExpressionEngine(const MathExpressionEngine&) = delete¶
No documentation provided.
-
Dune::XT::Functions::internal::MathExpressionEngine::~MathExpressionEngine()¶
No documentation provided.
-
int Dune::XT::Functions::internal::MathExpressionEngine::impl_¶
No documentation provided.