pub fn direct(
f: impl FnMut(&[f64]) -> f64,
lower: &[f64],
upper: &[f64],
options: DirectOptions,
) -> Result<GlobalResult, ErrorsJSL>Expand description
DIRECT, “DIviding RECTangles” (Jones, Perttunen and Stuckman, 1993), in Gablonsky and Kelley’s
locally biased form DIRECT-L. The domain is scaled to the unit cube and covered by boxes, each
evaluated at its centre. Each iteration selects the potentially optimal boxes, those on the
lower-right convex hull of (size, value), one per size, whose value could be the lowest for some
Lipschitz constant K with a gain of at least ε |f_min|. Each selected box is trisected along
its longest sides, the side whose new centres give the lowest value first. No gradients, no
randomness: the search balances global exploration (large boxes) against local refinement.