pub fn nelder_mead_minimize<F>(
f: F,
x0: &[f64],
bounds: Option<&[(f64, f64)]>,
config: &NelderMeadConfig,
) -> Result<NelderMeadResult, FittingError>Expand description
Minimize a scalar objective with optional per-coordinate box bounds.
fmust be non-panicking; it may returnErrto signal an infeasible point (the NM logic treats the vertex as +∞ and contracts away from it).x0is the initial point. An initial simplex ofn+1vertices is built by perturbing each coordinate in turn.bounds, if present, must have the same length asx0. Each pair is(lower, upper); usef64::NEG_INFINITY/f64::INFINITYto disable.
§Panics
Does not panic on infeasible objective values. Panics only if x0 is
empty or bounds.len() != x0.len().