pub struct BrentRoot<F> { /* private fields */ }
Expand description
Brent’s method
A root-finding algorithm combining the bisection method, the secant method and inverse quadratic interpolation. It has the reliability of bisection but it can be as quick as some of the less-reliable methods.
Requirements on the optimization problem
The optimization problem is required to implement CostFunction
.
Reference
Implementations§
Trait Implementations§
source§impl<'de, F> Deserialize<'de> for BrentRoot<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for BrentRoot<F>where F: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<O, F> Solver<O, IterState<F, (), (), (), F>> for BrentRoot<F>where
O: CostFunction<Param = F, Output = F>,
F: ArgminFloat,
impl<O, F> Solver<O, IterState<F, (), (), (), F>> for BrentRoot<F>where O: CostFunction<Param = F, Output = F>, F: ArgminFloat,
source§fn init(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn init( &mut self, problem: &mut Problem<O>, state: IterState<F, (), (), (), F> ) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
Initializes the algorithm. Read more
source§fn next_iter(
&mut self,
problem: &mut Problem<O>,
state: IterState<F, (), (), (), F>
) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
fn next_iter( &mut self, problem: &mut Problem<O>, state: IterState<F, (), (), (), F> ) -> Result<(IterState<F, (), (), (), F>, Option<KV>), Error>
Computes a single iteration of the algorithm and has access to the optimization problem
definition and the internal state of the solver.
Returns an updated
state
and optionally a KV
which holds key-value pairs used in
Observers.source§fn terminate_internal(&mut self, state: &I) -> TerminationStatus
fn terminate_internal(&mut self, state: &I) -> TerminationStatus
Checks whether basic termination reasons apply. Read more
source§fn terminate(&mut self, _state: &I) -> TerminationStatus
fn terminate(&mut self, _state: &I) -> TerminationStatus
Used to implement stopping criteria, in particular criteria which are not covered by
(
terminate_internal
. Read more