Skip to main content

evaluate_with_workspace

Function evaluate_with_workspace 

Source
pub fn evaluate_with_workspace(
    expr: &Expression,
    x: f64,
    workspace: &mut EvalWorkspace,
) -> Result<EvalResult, EvalError>
Expand description

Evaluate an expression at a given value of x, using a reusable workspace.

This is the hot-path version that avoids heap allocations. Use this in loops where evaluate() is called many times.

Note: This is a convenience wrapper for the full evaluate_with_workspace_and_constants_and_functions when you don’t need user constants or functions. It’s provided as a simpler API for common cases.