Skip to main content

eval_cost

Function eval_cost 

Source
pub fn eval_cost(
    expr: &CompiledCostExpr,
    bindings: &HashMap<String, f64>,
) -> Result<f64, CostEvalError>
Expand description

Evaluate a CompiledCostExpr against bindings (symbol โ†’ capacity value). The CompiledCostExpr::Unknown sentinel evaluates to 0.0.

Symbols absent from bindings are an CostEvalError โ€” the caller (the register slice) supplies the ยง2.3 vocabulary (m, n, k, element count, dtype_bytes, plus op-param names).