Skip to main content

ObjectiveMerit

Trait ObjectiveMerit 

Source
pub trait ObjectiveMerit:
    Clone
    + Debug
    + Display {
    const SEARCHES: bool = true;
    const MERIT: bool = true;

    // Required methods
    fn search<X, J, D, W, E>(
        &self,
        function: impl FnMut(&X, Scalar) -> Result<Scalar, String>,
        jacobian: impl FnMut(&X) -> Result<J, String>,
        argument: &X,
        jacobian0: &J,
        decrement: &D,
        step_size: Scalar,
    ) -> Result<Scalar, LineSearchError>
       where J: Erase<Erased = E> + Jacobian,
             D: Erase<Erased = E>,
             E: Tensor,
             X: Solution,
             for<'a> &'a D: Mul<Quantity<W>, Output = X>;
    fn search_merit(
        &self,
        merit: impl FnMut(Scalar) -> Result<Scalar, String>,
        value: Scalar,
        slope: Scalar,
        step_size: Scalar,
    ) -> Result<Scalar, LineSearchError>;
}
Expand description

Line searches that judge a step by a merit built from the objective.

The objective is the function being minimized, plus a penalty where it is constrained, so these are the searches a minimization can take and a root cannot: a root has no objective to compare the values of.

Provided Associated Constants§

Source

const SEARCHES: bool = true

Whether anything is searched at all.

Source

const MERIT: bool = true

Whether the value and slope of the merit are read, and so worth preparing.

Required Methods§

Source

fn search<X, J, D, W, E>( &self, function: impl FnMut(&X, Scalar) -> Result<Scalar, String>, jacobian: impl FnMut(&X) -> Result<J, String>, argument: &X, jacobian0: &J, decrement: &D, step_size: Scalar, ) -> Result<Scalar, LineSearchError>
where J: Erase<Erased = E> + Jacobian, D: Erase<Erased = E>, E: Tensor, X: Solution, for<'a> &'a D: Mul<Quantity<W>, Output = X>,

Backtrack along a step of the objective, whose gradient is known.

Source

fn search_merit( &self, merit: impl FnMut(Scalar) -> Result<Scalar, String>, value: Scalar, slope: Scalar, step_size: Scalar, ) -> Result<Scalar, LineSearchError>

Backtrack on a merit function of the step size alone.

The exact penalty function is not differentiable, its norm having a kink wherever a constraint is satisfied, so its slope along the step is supplied rather than recovered from a gradient.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§