Expand description

Bisector

Bisector is a flexible and stateless implementation of the bisection method for Rust.

For a detailed description of how the bisection method can be applied, see Bisector::bisect. The Bisector also provides the Bisector::try_bisect method which may be used when the convergence function is fallible.

Examples

Examples can be found in the examples folder of this crate (Examples on GitHub). You can also look at the tests, which can be found in the src/tests/ folder (Tests on Github).

An example of actual usage can be found in the cargo msrv project.

NB: Linked revision of usage in cargo msrv was implemented before Bisector::try_bisect was added. To cover a fallible case in the convergence function, you may want to use Bisector::try_bisect over Bisector::bisect.

Structs

Stateless implementation of the bisection method.

The left and right indices, which in combination with the slice held by the Bisector, provide the view on which a bisection step can be applied.

The output of one bisection step.

Enums

The direction towards which a step of the Bisector should converge.