pub struct SquareMatrix {
pub n: usize,
pub data: Vec<f64>,
}Expand description
Dense column-major-agnostic square matrix stored row-major.
Fields§
§n: usize§data: Vec<f64>Implementations§
Source§impl SquareMatrix
impl SquareMatrix
pub fn zeros(n: usize) -> Self
pub fn get(&self, i: usize, j: usize) -> f64
pub fn set(&mut self, i: usize, j: usize, v: f64)
Sourcepub fn cholesky(&self) -> Result<SquareMatrix>
pub fn cholesky(&self) -> Result<SquareMatrix>
In-place lower Cholesky factor L with A = L Lᵀ.
Sourcepub fn cholesky_solve(l: &SquareMatrix, b: &[f64]) -> Vec<f64>
pub fn cholesky_solve(l: &SquareMatrix, b: &[f64]) -> Vec<f64>
Solve A x = b given the Cholesky factor L of A.
Sourcepub fn cholesky_solve_leading(l: &SquareMatrix, k: usize, b: &[f64]) -> Vec<f64>
pub fn cholesky_solve_leading(l: &SquareMatrix, k: usize, b: &[f64]) -> Vec<f64>
Solve the leading k × k subsystem A[..k, ..k] x = b given the Cholesky
factor L of the full matrix. Valid because the Cholesky factor of a
leading principal submatrix is the leading submatrix of the factor, which
lets one O(n³) factorisation serve every nested model.
Sourcepub fn cholesky_inverse_diag(l: &SquareMatrix) -> Vec<f64>
pub fn cholesky_inverse_diag(l: &SquareMatrix) -> Vec<f64>
Diagonal of A⁻¹ from the Cholesky factor (solves n unit systems; O(n³),
fine for n = p_n ≤ ~50).
Trait Implementations§
Source§impl Clone for SquareMatrix
impl Clone for SquareMatrix
Source§fn clone(&self) -> SquareMatrix
fn clone(&self) -> SquareMatrix
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SquareMatrix
impl RefUnwindSafe for SquareMatrix
impl Send for SquareMatrix
impl Sync for SquareMatrix
impl Unpin for SquareMatrix
impl UnsafeUnpin for SquareMatrix
impl UnwindSafe for SquareMatrix
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