[]Trait argmin::prelude::Solver

pub trait Solver<O>: Serialize where
    O: ArgminOp
{ 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 { ... } }

Associated Constants

const NAME: &'static str

Loading content...

Required methods

fn next_iter(
    &mut self,
    op: &mut OpWrapper<O>,
    state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>

Computes one iteration of the algorithm.

Loading content...

Provided methods

fn init(
    &mut self,
    _op: &mut OpWrapper<O>,
    _state: &IterState<O>
) -> Result<Option<ArgminIterData<O>>, Error>

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.

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

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.

fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason

Checks whether the algorithm must be terminated

Loading content...

Implementors

impl<'a, O> Solver<O> for ParticleSwarm<'a, O> where
    O: ArgminOp<Output = f64>,
    <O as ArgminOp>::Param: Position,
    <O as ArgminOp>::Hessian: Clone + Default
[src]

fn next_iter(
    &mut self,
    _op: &mut OpWrapper<O>,
    _state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
[src]

Perform one iteration of algorithm

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason

impl<O> Solver<O> for GaussNewton where
    O: ArgminOp,
    O::Param: Default + ArgminScaledSub<O::Param, f64, O::Param> + ArgminSub<O::Param, O::Param> + ArgminMul<f64, O::Param>,
    O::Output: ArgminNorm<f64>,
    O::Jacobian: ArgminTranspose + ArgminInv<O::Jacobian> + ArgminDot<O::Jacobian, O::Jacobian> + ArgminDot<O::Output, O::Param> + ArgminDot<O::Param, O::Param>,
    O::Hessian: Default
[src]

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

impl<O> Solver<O> for Landweber where
    O: ArgminOp,
    O::Param: ArgminScaledSub<O::Param, f64, O::Param>, 
[src]

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

impl<O> Solver<O> for NelderMead<O> where
    O: ArgminOp<Output = f64>,
    O::Param: Default + Debug + ArgminScaledSub<O::Param, f64, O::Param> + ArgminSub<O::Param, O::Param> + ArgminAdd<O::Param, O::Param> + ArgminMul<f64, O::Param>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O> Solver<O> for Newton where
    O: ArgminOp,
    O::Param: ArgminScaledSub<O::Param, f64, O::Param>,
    O::Hessian: ArgminInv<O::Hessian> + ArgminDot<O::Param, O::Param>, 
[src]

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

impl<O> Solver<O> for SimulatedAnnealing where
    O: ArgminOp<Output = f64>, 
[src]

fn next_iter(
    &mut self,
    op: &mut OpWrapper<O>,
    state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
[src]

Perform one iteration of SA algorithm

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O> Solver<O> for CauchyPoint where
    O: ArgminOp<Output = f64>,
    O::Param: Debug + Clone + Serialize + ArgminMul<f64, O::Param> + ArgminWeightedDot<O::Param, f64, O::Hessian> + ArgminNorm<f64>,
    O::Hessian: Clone + Serialize
[src]

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

impl<O> Solver<O> for Dogleg where
    O: ArgminOp<Output = f64>,
    O::Param: Debug + ArgminMul<f64, O::Param> + ArgminWeightedDot<O::Param, f64, O::Hessian> + ArgminNorm<f64> + ArgminDot<O::Param, f64> + ArgminAdd<O::Param, O::Param> + ArgminSub<O::Param, O::Param>,
    O::Hessian: ArgminInv<O::Hessian> + ArgminDot<O::Param, O::Param>, 
[src]

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

impl<O, B, R> Solver<O> for SR1TrustRegion<B, R> where
    O: ArgminOp<Output = f64, Hessian = B>,
    O::Param: Debug + Clone + Default + Serialize + ArgminSub<O::Param, O::Param> + ArgminAdd<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminDot<O::Param, O::Hessian> + ArgminNorm<f64> + ArgminZeroLike + ArgminMul<f64, O::Param>,
    O::Hessian: Debug + Clone + Default + Serialize + DeserializeOwned + ArgminSub<O::Hessian, O::Hessian> + ArgminDot<O::Param, O::Param> + ArgminDot<O::Hessian, O::Hessian> + ArgminAdd<O::Hessian, O::Hessian> + ArgminMul<f64, O::Hessian>,
    R: ArgminTrustRegion + Solver<OpWrapper<O>>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O, L> Solver<O> for GaussNewtonLS<L> where
    O: ArgminOp,
    O::Param: Default + Debug + ArgminScaledSub<O::Param, f64, O::Param> + ArgminSub<O::Param, O::Param> + ArgminMul<f64, O::Param>,
    O::Output: ArgminNorm<f64>,
    O::Jacobian: ArgminTranspose + ArgminInv<O::Jacobian> + ArgminDot<O::Jacobian, O::Jacobian> + ArgminDot<O::Output, O::Param> + ArgminDot<O::Param, O::Param>,
    O::Hessian: Default,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<LineSearchOP<O>>>, 
[src]

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

impl<O, L> Solver<O> for SteepestDescent<L> where
    O: ArgminOp<Output = f64>,
    O::Param: Clone + Default + Serialize + ArgminSub<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminScaledAdd<O::Param, f64, O::Param> + ArgminMul<f64, O::Param> + ArgminSub<O::Param, O::Param> + ArgminNorm<f64>,
    O::Hessian: Default,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<O>>, 
[src]

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

impl<O, L> Solver<O> for NewtonCG<L> where
    O: ArgminOp<Output = f64>,
    O::Param: Send + Sync + Clone + Serialize + Default + ArgminSub<O::Param, O::Param> + ArgminAdd<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminScaledAdd<O::Param, f64, O::Param> + ArgminMul<f64, O::Param> + ArgminConj + ArgminZeroLike + ArgminNorm<f64>,
    O::Hessian: Send + Sync + Clone + Serialize + Default + ArgminInv<O::Hessian> + ArgminDot<O::Param, O::Param>,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<O>>, 
[src]

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

impl<O, L, H> Solver<O> for BFGS<L, H> where
    O: ArgminOp<Output = f64, Hessian = H>,
    O::Param: Debug + Default + ArgminSub<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminDot<O::Param, O::Hessian> + ArgminScaledAdd<O::Param, f64, O::Param> + ArgminNorm<f64> + ArgminMul<f64, O::Param>,
    O::Hessian: Clone + Default + Debug + Serialize + DeserializeOwned + ArgminSub<O::Hessian, O::Hessian> + ArgminDot<O::Param, O::Param> + ArgminDot<O::Hessian, O::Hessian> + ArgminAdd<O::Hessian, O::Hessian> + ArgminMul<f64, O::Hessian> + ArgminTranspose + ArgminEye,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<O>>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O, L, H> Solver<O> for DFP<L, H> where
    O: ArgminOp<Output = f64, Hessian = H>,
    O::Param: Clone + Default + Serialize + ArgminSub<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminDot<O::Param, O::Hessian> + ArgminScaledAdd<O::Param, f64, O::Param> + ArgminNorm<f64> + ArgminMul<f64, O::Param> + ArgminTranspose,
    O::Hessian: Clone + Default + Serialize + DeserializeOwned + ArgminSub<O::Hessian, O::Hessian> + ArgminDot<O::Param, O::Param> + ArgminDot<O::Hessian, O::Hessian> + ArgminAdd<O::Hessian, O::Hessian> + ArgminMul<f64, O::Hessian> + ArgminTranspose + ArgminEye,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<O>>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O, L, H> Solver<O> for SR1<L, H> where
    O: ArgminOp<Output = f64, Hessian = H>,
    O::Param: Debug + Clone + Default + Serialize + ArgminSub<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminDot<O::Param, O::Hessian> + ArgminNorm<f64> + ArgminMul<f64, O::Param>,
    O::Hessian: Debug + Clone + Default + Serialize + DeserializeOwned + ArgminSub<O::Hessian, O::Hessian> + ArgminDot<O::Param, O::Param> + ArgminDot<O::Hessian, O::Hessian> + ArgminAdd<O::Hessian, O::Hessian> + ArgminMul<f64, O::Hessian>,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<O>>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O, L, P> Solver<O> for LBFGS<L, P> where
    O: ArgminOp<Param = P, Output = f64>,
    O::Param: Clone + Serialize + DeserializeOwned + Debug + Default + ArgminSub<O::Param, O::Param> + ArgminAdd<O::Param, O::Param> + ArgminDot<O::Param, f64> + ArgminScaledAdd<O::Param, f64, O::Param> + ArgminNorm<f64> + ArgminMul<f64, O::Param>,
    O::Hessian: Clone + Default + Serialize + DeserializeOwned,
    L: Clone + ArgminLineSearch<O::Param> + Solver<OpWrapper<O>>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O, P, L> Solver<O> for BacktrackingLineSearch<P, L> where
    P: Clone + Default + Serialize + DeserializeOwned + ArgminSub<P, P> + ArgminDot<P, f64> + ArgminScaledAdd<P, f64, P>,
    O: ArgminOp<Param = P, Output = f64>,
    L: LineSearchCondition<P>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<O, P, L, B> Solver<O> for NonlinearConjugateGradient<P, L, B> where
    O: ArgminOp<Param = P, Output = f64>,
    P: Clone + Default + Serialize + DeserializeOwned + ArgminSub<P, P> + ArgminDot<P, f64> + ArgminScaledAdd<P, f64, P> + ArgminAdd<P, P> + ArgminMul<f64, P> + ArgminDot<P, f64> + ArgminNorm<f64>,
    O::Hessian: Default,
    L: Clone + ArgminLineSearch<P> + Solver<OpWrapper<O>>,
    B: ArgminNLCGBetaUpdate<P>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason

impl<O, R> Solver<O> for TrustRegion<R> where
    O: ArgminOp<Output = f64>,
    O::Param: Default + Clone + Debug + Serialize + ArgminMul<f64, O::Param> + ArgminWeightedDot<O::Param, f64, O::Hessian> + ArgminNorm<f64> + ArgminDot<O::Param, f64> + ArgminAdd<O::Param, O::Param> + ArgminSub<O::Param, O::Param> + ArgminZeroLike + ArgminMul<f64, O::Param>,
    O::Hessian: Default + Clone + Debug + Serialize + ArgminDot<O::Param, O::Param>,
    R: ArgminTrustRegion + Solver<OpWrapper<O>>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<P, O> Solver<O> for HagerZhangLineSearch<P> where
    O: ArgminOp<Param = P, Output = f64>,
    P: Clone + Default + Serialize + DeserializeOwned + ArgminSub<P, P> + ArgminDot<P, f64> + ArgminScaledAdd<P, f64, P>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<P, O> Solver<O> for MoreThuenteLineSearch<P> where
    O: ArgminOp<Param = P, Output = f64>,
    P: Clone + Serialize + DeserializeOwned + ArgminSub<P, P> + ArgminDot<P, f64> + ArgminScaledAdd<P, f64, P>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason

impl<P, O> Solver<O> for Steihaug<P> where
    O: ArgminOp<Param = P, Output = f64>,
    P: Clone + Serialize + DeserializeOwned + Default + ArgminMul<f64, P> + ArgminWeightedDot<P, f64, O::Hessian> + ArgminNorm<f64> + ArgminDot<P, f64> + ArgminAdd<P, P> + ArgminSub<P, P> + ArgminZeroLike + ArgminMul<f64, P>,
    O::Hessian: ArgminDot<P, P>, 
[src]

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

impl<P, O, S> Solver<O> for ConjugateGradient<P, S> where
    O: ArgminOp<Param = P, Output = P>,
    P: Clone + Serialize + DeserializeOwned + ArgminDot<P, S> + ArgminSub<P, P> + ArgminScaledAdd<P, S, P> + ArgminAdd<P, P> + ArgminConj + ArgminMul<f64, P>,
    S: Debug + ArgminDiv<S, S> + ArgminNorm<f64> + ArgminConj
[src]

fn next_iter(
    &mut self,
    op: &mut OpWrapper<O>,
    state: &IterState<O>
) -> Result<ArgminIterData<O>, Error>
[src]

Perform one iteration of CG algorithm

fn terminate_internal(&mut self, state: &IterState<O>) -> TerminationReason

fn terminate(&mut self, _state: &IterState<O>) -> TerminationReason

Loading content...