Skip to main content

JacobianOperator

Trait JacobianOperator 

Source
pub trait JacobianOperator {
    // Required methods
    fn residual(&mut self, x: &[f64]) -> Vec<f64>;
    fn linearize(&mut self, x: &[f64]) -> Result<Vec<f64>, DspError>;
    fn jvp(&self, direction: &[f64], out: &mut [f64]) -> Result<(), DspError>;
    fn vjp(
        &self,
        residual_direction: &[f64],
        out: &mut [f64],
    ) -> Result<(), DspError>;
}
Expand description

A real residual with an independently retained linearization.

linearize returns the squared Euclidean norm of each Jacobian column. Subsequent products use that base point until the next linearize call; evaluating trial residuals must not invalidate it. Products overwrite all entries of the supplied output buffer and use real inner products, including when the implementation internally uses complex spectra.

Required Methods§

Source

fn residual(&mut self, x: &[f64]) -> Vec<f64>

Source

fn linearize(&mut self, x: &[f64]) -> Result<Vec<f64>, DspError>

Source

fn jvp(&self, direction: &[f64], out: &mut [f64]) -> Result<(), DspError>

Source

fn vjp( &self, residual_direction: &[f64], out: &mut [f64], ) -> Result<(), DspError>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§