Trait argmin::core::Solver[][src]

pub trait Solver<O: ArgminOp>: Serialize {
    const NAME: &'static str;

    fn next_iter(
        &mut self,
        op: &mut OpWrapper<O>,
        state: &IterState<O>
    ) -> Result<ArgminIterData<O>, Error>; fn init(
        &mut self,
        _op: &mut OpWrapper<O>,
        _state: &IterState<O>
    ) -> Result<Option<ArgminIterData<O>>, Error> { ... }
fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason { ... }
fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason { ... } }
Expand description

Solver

Every solver needs to implement this trait.

Associated Constants

Name of the solver

Required methods

Computes one iteration of the algorithm.

Provided methods

Initializes the algorithm

This is executed before any iterations are performed. It can be used to perform precomputations. The default implementation corresponds to doing nothing.

Checks whether basic termination reasons apply.

Terminate if

  1. algorithm was terminated somewhere else in the Executor
  2. iteration count exceeds maximum number of iterations
  3. cost is lower than target cost

This can be overwritten in a Solver implementation; however it is not advised.

Checks whether the algorithm must be terminated

Implementors