Shrinkage

shrinkage::ProximalDesign

Shrinkage for Rust · rust · 0.3.0

pub trait ProximalDesign

A prepared CPU design oracle for proximal gradient.

Products use the optimization-scale design. Each call operates on complete slices so runtime dispatch stays outside scalar loops. Concrete adapters retain LazyMatrix normalization, native product buffers, and column views. This solver capability does not replace LazyMatrix's matrix traits.

Associated types

Error

type Error;

Backend failure type.

Methods

forward

fn forward(
    &mut self,
    input: &[f64],
    output: &mut [f64]
) -> Result<(), FitError<<Self as ProximalDesign>::Error>>

Write the normalized forward product into reusable output storage.

Errors

Reject mismatched dimensions and preserve backend failures. Output is unspecified after an error and must not be consumed.

into_preprocessing

fn into_preprocessing(self: Box<Self>) -> Preprocessing

Consume the prepared design and retain its fitted normalization vectors.

ncols

fn ncols(&self) -> usize

Number of coefficients.

nrows

fn nrows(&self) -> usize

Number of observations.

screening_design

fn screening_design(
    &mut self
) -> Option<&mut dyn ScreeningDesign<Error = <Self as ProximalDesign>::Error>>

Borrow optional normalized-column operations for safe screening.

Product-only adapters can retain their existing implementation. The solver screens only when the design exposes this capability.

transpose

fn transpose(
    &mut self,
    input: &[f64],
    output: &mut [f64]
) -> Result<(), FitError<<Self as ProximalDesign>::Error>>

Write the normalized transposed product into reusable output storage.

Errors

Reject mismatched dimensions and preserve backend failures. Output is unspecified after an error and must not be consumed.