pub trait ArgminOp {
type Param: Clone + Serialize + DeserializeOwned;
type Output: Clone + Serialize + DeserializeOwned;
type Hessian: Clone + Serialize + DeserializeOwned;
type Jacobian: Clone + Serialize + DeserializeOwned;
type Float: ArgminFloat;
// Provided methods
fn apply(&self, _param: &Self::Param) -> Result<Self::Output, Error> { ... }
fn gradient(&self, _param: &Self::Param) -> Result<Self::Param, Error> { ... }
fn hessian(&self, _param: &Self::Param) -> Result<Self::Hessian, Error> { ... }
fn jacobian(&self, _param: &Self::Param) -> Result<Self::Jacobian, Error> { ... }
fn modify(
&self,
_param: &Self::Param,
_extent: Self::Float,
) -> Result<Self::Param, 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§
Sourcetype Param: Clone + Serialize + DeserializeOwned
type Param: Clone + Serialize + DeserializeOwned
Type of the parameter vector
Sourcetype Output: Clone + Serialize + DeserializeOwned
type Output: Clone + Serialize + DeserializeOwned
Output of the operator
Sourcetype Hessian: Clone + Serialize + DeserializeOwned
type Hessian: Clone + Serialize + DeserializeOwned
Type of Hessian
Sourcetype Jacobian: Clone + Serialize + DeserializeOwned
type Jacobian: Clone + Serialize + DeserializeOwned
Type of Jacobian
Sourcetype Float: ArgminFloat
type Float: ArgminFloat
Precision of floats
Provided Methods§
Sourcefn apply(&self, _param: &Self::Param) -> Result<Self::Output, Error>
fn apply(&self, _param: &Self::Param) -> Result<Self::Output, Error>
Applies the operator/cost function to parameters
Sourcefn gradient(&self, _param: &Self::Param) -> Result<Self::Param, Error>
fn gradient(&self, _param: &Self::Param) -> Result<Self::Param, Error>
Computes the gradient at the given parameters
Sourcefn hessian(&self, _param: &Self::Param) -> Result<Self::Hessian, Error>
fn hessian(&self, _param: &Self::Param) -> Result<Self::Hessian, Error>
Computes the Hessian at the given parameters
Implementors§
Source§impl ArgminOp for MinimalNoOperator
impl ArgminOp for MinimalNoOperator
Source§impl<O: ArgminOp> ArgminOp for OpWrapper<O>
impl<O: ArgminOp> ArgminOp for OpWrapper<O>
The OpWrapperArgminOp