Skip to main content

ResidualMerit

Trait ResidualMerit 

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

    // Required method
    fn search_residual(
        &self,
        merit: impl FnMut(Scalar) -> Result<Scalar, String>,
        value: Scalar,
        fraction: Scalar,
    ) -> Result<Scalar, LineSearchError>;
}
Expand description

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

The merit is half the squared norm of the residual being driven to zero. Along an exact Newton step its slope is the negative of twice itself, so nothing beyond the residual need be known.

Provided Associated Constants§

Source

const SEARCHES: bool = true

Whether anything is searched at all.

Source

const MERIT: bool = true

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

Required Methods§

Source

fn search_residual( &self, merit: impl FnMut(Scalar) -> Result<Scalar, String>, value: Scalar, fraction: Scalar, ) -> Result<Scalar, LineSearchError>

Backtrack on the residual merit of the step size alone.

The step is judged along the share fraction of a step, which is one unless something shortened the step beforehand.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§