Skip to main content

LinearizationMode

Trait LinearizationMode 

Source
pub trait LinearizationMode: 'static {
    type Jacobian: Send + Sync;
    type Hessian: Send + Sync;
}
Expand description

Marker trait that defines the matrix types for a linear algebra path.

Enables zero-cost static dispatch between sparse and dense linear algebra backends. Optimizers are generic over LinearizationMode, so the compiler generates one specialization per concrete mode at no runtime cost.

Two implementations are provided:

  • SparseMode: Jacobian and Hessian are SparseColMat<usize, f64>
  • DenseMode: Jacobian and Hessian are Mat<f64>

Required Associated Types§

Source

type Jacobian: Send + Sync

The Jacobian matrix type (SparseColMat or Mat)

Source

type Hessian: Send + Sync

The Hessian matrix type (SparseColMat or Mat)

Implementors§