pub struct MultiVectorMatrix { /* private fields */ }Implementations§
Source§impl MultiVectorMatrix
impl MultiVectorMatrix
pub fn new(space: Rc<MultiVectorMatrixSpace>) -> Self
pub fn space(&self) -> &Rc<MultiVectorMatrixSpace>
pub fn col_vector_space(&self) -> &Rc<DenseVectorSpace>
Sourcepub fn set_vector(&mut self, i: Index, vec: Rc<dyn Vector>)
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).
pub fn get_vector(&self, i: Index) -> &Rc<dyn Vector>
Sourcepub fn fill_with_new_vectors(&mut self)
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.
Sourcepub fn lr_mult_vector(
&self,
alpha: Number,
x: &dyn Vector,
beta: Number,
y: &mut dyn Vector,
)
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.
Sourcepub fn scale_columns(&mut self, scal: &DenseVector)
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).
Sourcepub fn scale_rows(&mut self, scal: &dyn Vector)
pub fn scale_rows(&mut self, scal: &dyn Vector)
V[:, i] ← V[:, i] .* scal_vec for every column. Port of
ScaleRows.
Sourcepub fn add_one_multi_vector_matrix(
&mut self,
a: Number,
mv1: &MultiVectorMatrix,
c: Number,
)
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.
Sourcepub fn add_right_mult_matrix(
&mut self,
a: Number,
u: &MultiVectorMatrix,
c_mat: &DenseGenMatrix,
b: Number,
)
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
impl Debug for MultiVectorMatrix
Source§impl Matrix for MultiVectorMatrix
impl Matrix for MultiVectorMatrix
Source§fn mult_vector_impl(
&self,
alpha: Number,
x: &dyn Vector,
beta: Number,
y: &mut dyn Vector,
)
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,
)
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).
fn n_rows(&self) -> Index
fn n_cols(&self) -> Index
fn cache(&self) -> &MatrixCache
fn as_any(&self) -> &dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
fn as_tagged(&self) -> &dyn TaggedObject
fn as_dyn_matrix(&self) -> &dyn Matrix
Source§fn has_valid_numbers_impl(&self) -> bool
fn has_valid_numbers_impl(&self) -> bool
Source§fn compute_row_amax_impl(&self, _rows_norms: &mut dyn Vector, _init: bool)
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)
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,
)
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,
)
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.