pub struct Matrix<const R: usize, const C: usize> { /* private fields */ }Expand description
Dense R × C f64 matrix.
Implementations§
Source§impl<const R: usize, const C: usize> Matrix<R, C>
impl<const R: usize, const C: usize> Matrix<R, C>
Sourcepub fn from_fn(element: impl FnMut(usize, usize) -> f64) -> Self
pub fn from_fn(element: impl FnMut(usize, usize) -> f64) -> Self
Element (row, column) from a closure.
Sourcepub fn get(&self, row: usize, column: usize) -> Option<f64>
pub fn get(&self, row: usize, column: usize) -> Option<f64>
Element at (row, column); None outside.
Source§impl<const N: usize> Matrix<N, N>
impl<const N: usize> Matrix<N, N>
Sourcepub fn symmetrised(&self) -> Self
pub fn symmetrised(&self) -> Self
(A + Aᵀ) / 2: exactly symmetric; unchanged for a symmetric input.
Removes the last-place asymmetries a covariance accumulates through products.
Sourcepub fn cholesky(&self) -> Option<Cholesky<N>>
pub fn cholesky(&self) -> Option<Cholesky<N>>
Cholesky factor L with self = L Lᵀ; None unless symmetric positive
definite.
A pivot ≤ 0 within a matrix-scaled tolerance (an unobserved state can
have exactly zero variance) means not positive definite; the result is
None, not a factor of NaNs. Non-iterative: N³/6 operations.
Sourcepub fn is_covariance(&self) -> bool
pub fn is_covariance(&self) -> bool
Whether symmetric (relative tolerance) and positive semi-definite, as
judged by Matrix::cholesky.
Trait Implementations§
impl<const R: usize, const C: usize> Copy for Matrix<R, C>
impl<const R: usize, const C: usize> StructuralPartialEq for Matrix<R, C>
Auto Trait Implementations§
impl<const R: usize, const C: usize> Freeze for Matrix<R, C>
impl<const R: usize, const C: usize> RefUnwindSafe for Matrix<R, C>
impl<const R: usize, const C: usize> Send for Matrix<R, C>
impl<const R: usize, const C: usize> Sync for Matrix<R, C>
impl<const R: usize, const C: usize> Unpin for Matrix<R, C>
impl<const R: usize, const C: usize> UnsafeUnpin for Matrix<R, C>
impl<const R: usize, const C: usize> UnwindSafe for Matrix<R, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more