pub trait ArgminOperator {
    type Parameters;
    type OperatorOutput;
    type Hessian;

    fn apply(&self, _: &Self::Parameters) -> Result<Self::OperatorOutput, Error>;

    fn gradient(&self, : &Self::Parameters) -> Result<Self::Parameters, Error> { ... }
    fn hessian(&self, : &Self::Parameters) -> Result<Self::Hessian, Error> { ... }
    fn modify(
        &self,
        : &Self::Parameters,
        : f64
    ) -> Result<Self::Parameters, Error> { ... } }
Expand description

This trait needs to be implemented for every operator/cost function.

It is required to implement the apply method, all others are optional and provide a default implementation which is essentially returning an error which indicates that the method has not been implemented. Those methods (gradient and modify) only need to be implemented if the uses solver requires it.

Required Associated Types

Type of the parameter vector

Output of the operator. Most solvers expect f64.

Type of Hessian

Required Methods

Applies the operator/cost function to parameters

Provided Methods

Computes the gradient at the given parameters

Computes the hessian at the given parameters

Modifies a parameter vector. Comes with a variable that indicates the “degree” of the modification.

Implementors