Skip to main content

MultiVectorMatrix

Struct MultiVectorMatrix 

Source
pub struct MultiVectorMatrix { /* private fields */ }

Implementations§

Source§

impl MultiVectorMatrix

Source

pub fn new(space: Rc<MultiVectorMatrixSpace>) -> Self

Source

pub fn space(&self) -> &Rc<MultiVectorMatrixSpace>

Source

pub fn col_vector_space(&self) -> &Rc<DenseVectorSpace>

Source

pub fn set_vector(&mut self, i: Index, vec: Rc<dyn Vector>)

Sets column i to share vec. Replaces any previous occupant. Mirrors MultiVectorMatrix::SetVector (the const overload — since Rust enforces borrow rules statically, the non-const overload collapses into the same operation).

Source

pub fn get_vector(&self, i: Index) -> &Rc<dyn Vector>

Source

pub fn fill_with_new_vectors(&mut self)

Like upstream FillWithNewVectors: replaces every column with a freshly allocated, uninitialised dense vector from the column space.

Source

pub fn lr_mult_vector( &self, alpha: Number, x: &dyn Vector, beta: Number, y: &mut dyn Vector, )

y ← α V Vᵀ x + β y. Port of LRMultVector.

Source

pub fn scale_columns(&mut self, scal: &DenseVector)

V[:, i] ← a · V[:, i] (no-op if c==1) + scaled by ScalarVec helpers. Port of ScaleColumns for the dense, non-homogeneous case (homogeneous fast path is preserved).

Source

pub fn scale_rows(&mut self, scal: &dyn Vector)

V[:, i] ← V[:, i] .* scal_vec for every column. Port of ScaleRows.

Source

pub fn add_one_multi_vector_matrix( &mut self, a: Number, mv1: &MultiVectorMatrix, c: Number, )

V ← a · V1 + c · V (column-wise). When c == 0, replaces every column with a fresh allocation first, mirroring upstream.

Source

pub fn add_right_mult_matrix( &mut self, a: Number, u: &MultiVectorMatrix, c_mat: &DenseGenMatrix, b: Number, )

V ← a · U · C + b · V. C must be a DenseGenMatrix of shape (U.n_cols, V.n_cols). Port of AddRightMultMatrix. When b == 0, columns of V are reallocated first.

Trait Implementations§

Source§

impl Debug for MultiVectorMatrix

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Matrix for MultiVectorMatrix

Source§

fn mult_vector_impl( &self, alpha: Number, x: &dyn Vector, beta: Number, y: &mut dyn Vector, )

y ← α · V · x + β · y, where V·x = Σⱼ xⱼ · V[:, j]. Port of MultVectorImpl. Reduction order matches upstream: scal/set y first, then iterate columns left-to-right and accumulate via AddOneVector.

Source§

fn trans_mult_vector_impl( &self, alpha: Number, x: &dyn Vector, beta: Number, y: &mut dyn Vector, )

y[i] ← α · V[:, i]ᵀ · x + β · y[i]. Port of TransMultVectorImpl. y must be a DenseVector (matching upstream’s static_cast).

Source§

fn n_rows(&self) -> Index

Source§

fn n_cols(&self) -> Index

Source§

fn cache(&self) -> &MatrixCache

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

fn as_tagged(&self) -> &dyn TaggedObject

Source§

fn as_dyn_matrix(&self) -> &dyn Matrix

Source§

fn has_valid_numbers_impl(&self) -> bool

Default returns true. Concrete matrices override when they hold floating-point storage that may go NaN/Inf.
Source§

fn compute_row_amax_impl(&self, _rows_norms: &mut dyn Vector, _init: bool)

rows_norms[i] ← max(rows_norms[i], maxⱼ |M[i,j]|). Caller has already zeroed rows_norms if init.
Source§

fn compute_col_amax_impl(&self, _cols_norms: &mut dyn Vector, _init: bool)

cols_norms[j] ← max(cols_norms[j], maxᵢ |M[i,j]|). Caller has already zeroed cols_norms if init.
Source§

fn add_m_sinv_z_impl( &self, alpha: Number, s: &dyn Vector, z: &dyn Vector, x: &mut dyn Vector, )

X = X + α · M · S⁻¹ · Z. Default: build tmp = Z./S, then MultVector(α, tmp, 1, X). Override for ExpansionMatrix etc.
Source§

fn sinv_blrm_zmt_dbr_impl( &self, alpha: Number, s: &dyn Vector, r: &dyn Vector, z: &dyn Vector, d: &dyn Vector, x: &mut dyn Vector, )

X = S⁻¹ · (R + α · Z · Mᵀ · D). Default per upstream Matrix::SinvBlrmZMTdBrImpl.
Source§

fn mult_vector( &self, alpha: Number, x: &dyn Vector, beta: Number, y: &mut dyn Vector, )

Source§

fn trans_mult_vector( &self, alpha: Number, x: &dyn Vector, beta: Number, y: &mut dyn Vector, )

Source§

fn compute_row_amax(&self, rows_norms: &mut dyn Vector, init: bool)

Source§

fn compute_col_amax(&self, cols_norms: &mut dyn Vector, init: bool)

Source§

fn add_m_sinv_z( &self, alpha: Number, s: &dyn Vector, z: &dyn Vector, x: &mut dyn Vector, )

Source§

fn sinv_blrm_zmt_dbr( &self, alpha: Number, s: &dyn Vector, r: &dyn Vector, z: &dyn Vector, d: &dyn Vector, x: &mut dyn Vector, )

Source§

fn has_valid_numbers(&self) -> bool

Source§

impl TaggedObject for MultiVectorMatrix

Source§

fn get_tag(&self) -> Tag

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.