Skip to main content

plan_with_class

Function plan_with_class 

Source
pub fn plan_with_class(cap: &OuterCapability, class: SolverClass) -> OuterPlan
Expand description

Plan selection with an explicit SolverClass opt-in.

For SolverClass::Primary this is identical to plan — the main REML outer dispatch never changes behavior.

For SolverClass::AuxiliaryGradientFree with no declared gradient or Hessian capability, returns a Solver::CompassSearch plan. This is the sole path by which compass search can be dispatched; the primary REML builder never sets the aux class, so the direct-search variant cannot leak into the big REML outer or the automatic fallback cascade.

If the aux class is set but analytic gradient IS available, that is a caller error (the caller should have used Primary and let Arc/Bfgs handle it); we defer to the standard plan in that case so the caller still gets a well-formed plan rather than a silent mis-dispatch.