pub struct MinProblem {
pub lo: f64,
pub hi: f64,
}Expand description
One bracketed 1-D extremum problem: an interval believed to contain a single interior extremum of the objective.
§Fields and valid ranges
lo,hi— the bracket. Both must be finite, or the lane reportsMinStatus::InvalidBracket. They may be given in either order; the kernel normalises, exactly ascrate::math::parallel::RootProblemdoes. A degenerate bracket (lo == hi) converges immediately at that point with zero iterations, which is truthful: a zero-width bracket has already met any non-negative tolerance.
§The precondition golden section cannot check
The objective must be unimodal on [lo, hi] — one interior extremum, no
second basin. This is a precondition on the caller, not something the kernel
verifies; see the module-level warning. Note that a monotone objective on
the bracket is a benign special case: the contraction walks to the appropriate
endpoint and converges there, which is the intended behaviour when the real
extremum lies just outside. It is the multimodal case that is dangerous,
because the answer looks exactly like a correct one.
There is no guess field, unlike crate::math::parallel::RootProblem.
Golden section is driven entirely by the bracket and has nowhere to put a
starting iterate; a method that could use one (Brent’s parabolic
interpolation) is deliberately not implemented here — again, see the module
docs.
§Units
Dimensionless f64 in whatever units the caller’s abscissa carries — pascals
for a choke-pressure search, dimensionless for a blend factor. See the
module-level “Units” section.
§Example
use outram_foam_basic_lib::math::minimise::MinProblem;
let p = MinProblem::new(0.0, 1.0);
assert_eq!(p.width(), 1.0);
// Either order is accepted; the width is still positive.
let q = MinProblem::new(1.0, 0.0);
assert_eq!(q.width(), 1.0);Fields§
§lo: f64One end of the bracket. Finite; need not be less than hi.
hi: f64The other end of the bracket. Finite; need not be greater than lo.