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

    fn apply(&self, _: &Self::Parameters) -> Result<Self::OperatorOutput, Error>;
    fn box_clone(
        &self
    ) -> Box<dyn ArgminOperator<Parameters = Self::Parameters, OperatorOutput = Self::OperatorOutput, Hessian = Self::Hessian>>; fn gradient(&self, : &Self::Parameters) -> Result<Self::Parameters, Error> { ... } fn hessian(&self, : &Self::Parameters) -> Result<Self::Hessian, Error> { ... } fn modify(
        &mut 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 and box_clone methods, 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. The box_clone method can be ‘half automatically’ implemented using the box_clone! macro.

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

Allows to clone the boxed trait object.

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.

Trait Implementations

Implements clone for a boxed ArgminOperator. Requires obviously that box_clone is implemented (see ArgminOperator trait).

Performs copy-assignment from source. Read more

Implementors