pub trait DenseMatrix:
Matrix
+ for<'b> MatrixOpsByValue<&'b Self, Self>
+ for<'b> MatrixMutOpsByValue<&'b Self>
+ for<'a, 'b> MatrixOpsByValue<&'b Self::View<'a>, Self>
+ for<'a, 'b> MatrixMutOpsByValue<&'b Self::View<'a>> {
type View<'a>: MatrixView<'a, Owned = Self, T = Self::T, V = Self::V>
where Self: 'a;
type ViewMut<'a>: MatrixViewMut<'a, Owned = Self, T = Self::T, V = Self::V, View = Self::View<'a>>
where Self: 'a;
// Required methods
fn gemm(&mut self, alpha: Self::T, a: &Self, b: &Self, beta: Self::T);
fn column_axpy(&mut self, alpha: Self::T, j: IndexType, i: IndexType);
fn columns(&self, start: IndexType, end: IndexType) -> Self::View<'_>;
fn column(&self, i: IndexType) -> <Self::V as Vector>::View<'_>;
fn columns_mut(
&mut self,
start: IndexType,
end: IndexType,
) -> Self::ViewMut<'_>;
fn column_mut(&mut self, i: IndexType) -> <Self::V as Vector>::ViewMut<'_>;
fn set_index(&mut self, i: IndexType, j: IndexType, value: Self::T);
fn get_index(&self, i: IndexType, j: IndexType) -> Self::T;
fn from_vec(
nrows: IndexType,
ncols: IndexType,
data: Vec<Self::T>,
ctx: Self::C,
) -> Self;
// Provided method
fn mat_mul(&self, b: &Self) -> Self { ... }
}
Expand description
A dense column-major matrix. The assumption is that the underlying matrix is stored in column-major order, so functions for taking columns views are efficient
Required Associated Types§
Sourcetype View<'a>: MatrixView<'a, Owned = Self, T = Self::T, V = Self::V>
where
Self: 'a
type View<'a>: MatrixView<'a, Owned = Self, T = Self::T, V = Self::V> where Self: 'a
A view of the dense matrix type
Required Methods§
Sourcefn gemm(&mut self, alpha: Self::T, a: &Self, b: &Self, beta: Self::T)
fn gemm(&mut self, alpha: Self::T, a: &Self, b: &Self, beta: Self::T)
Perform a matrix-matrix multiplication self = alpha * a * b + beta * self
, where alpha
and beta
are scalars, and a
and b
are matrices
Sourcefn column_axpy(&mut self, alpha: Self::T, j: IndexType, i: IndexType)
fn column_axpy(&mut self, alpha: Self::T, j: IndexType, i: IndexType)
Performs an axpy operation on two columns of the matrix M[:, i] = alpha * M[:, j] + M[:, i]
Sourcefn columns(&self, start: IndexType, end: IndexType) -> Self::View<'_>
fn columns(&self, start: IndexType, end: IndexType) -> Self::View<'_>
Get a matrix view of the columns starting at start
and ending at end
Sourcefn column(&self, i: IndexType) -> <Self::V as Vector>::View<'_>
fn column(&self, i: IndexType) -> <Self::V as Vector>::View<'_>
Get a vector view of the column i
Sourcefn columns_mut(&mut self, start: IndexType, end: IndexType) -> Self::ViewMut<'_>
fn columns_mut(&mut self, start: IndexType, end: IndexType) -> Self::ViewMut<'_>
Get a mutable matrix view of the columns starting at start
and ending at end
Sourcefn column_mut(&mut self, i: IndexType) -> <Self::V as Vector>::ViewMut<'_>
fn column_mut(&mut self, i: IndexType) -> <Self::V as Vector>::ViewMut<'_>
Get a mutable vector view of the column i
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.