Expand description
Bisection of a bracket on which side of a crossing its middle lies —
in plain numbers, where where-exactly is a free choice found as far as
f64 goes, or in sharp scalars, where the side is told by an interval
test that may not decide — and the scan of samples that finds the
brackets: every pair of neighbouring samples on different sides.
Structs§
- Bracket
- Where a bisection ended: its bracket, and the middle whose side could not be told, if that is what stopped it.
- Crossings
- The brackets of a
SignChangesscan, bisected: seeSignChanges::bisected. - Sign
Changes - Neighbouring samples on different sides: see
sign_changes.
Traits§
- Bisect
- A value a bracket can be bisected in.
Functions§
- bisect
- Bisects
(lo, hi)at moststepstimes.side(mid)says whether the middle lies onlo’s side (Some(true), it becomeslo), onhi’s (Some(false)), or cannot be told (None, which stops the bisection). Withuntil_collapsed, it also stops once the middle no longer lies strictly inside the bracket.sidemay keep state of its own — a seed carried from one middle to the next — since every step asks it once. - sign_
changes - The pairs of neighbouring samples of
samplesthatsideputs on different sides, in order, each with the side of its first: brackets of a crossing.sidesays which side a sample lies on (< cutagainst<= 0, a sign of a number or of an interval: the caller’s choice), orNonewhere it cannot tell; such a sample is passed over, its neighbours paired across it. Lazy: a scan for the first crossing asks no sample past it.SignChanges::bisectedbisects each bracket.