Skip to main content

brute

Function brute 

Source
pub fn brute(
    f: impl Fn(&[f64]) -> f64,
    ranges: &[(f64, f64)],
    ns: usize,
    finish: bool,
) -> Result<BruteResult, ErrorsJSL>
Expand description

Minimises f by evaluating it at every point of the grid with ns equally spaced points from lo to hi (both included) on each axis (SciPy’s brute with (lo, hi) ranges and Ns = ns, SciPy’s default 20). With finish, the best grid point is polished by Nelder-Mead, as SciPy’s default finish = fmin, and kept only if the polished point is better.