Shrinkage

shrinkage::ProximalVector

Shrinkage for Rust · rust · 0.3.0

pub trait ProximalVector: Clone + ElemDivAssign<f64> + DotSlice<f64> + SubScalarAssign<f64> + SumEntries<f64> + ScaledSubSlice<f64>

Owned CPU storage for a backend's product vectors.

Matrix products and normalization remain in LazyMatrix. This capability supplies reusable buffers and bridges native vectors to the slice-based predictor and proximal capabilities. It does not represent device storage.

LazyMatrix vectors with VectorOwned<Owned = Self>, mutable indexed access, and the normalization operations below implement this trait automatically. Indexed access may be strided; it does not require contiguous storage.

Methods

get

fn get(&self, index: usize) -> f64

Read an entry in constant time.

set

fn set(&mut self, index: usize, value: f64)

Write an entry in constant time.

zeros

fn zeros(length: usize) -> Self

Allocate a zero vector of the requested length.