pub struct SPMatrix {
pub row: usize,
pub col: usize,
pub nnz: usize,
pub col_ptr: Vec<usize>,
pub row_ics: Vec<usize>,
pub data: Vec<f64>,
}
Fields§
§row: usize
§col: usize
§nnz: usize
§col_ptr: Vec<usize>
§row_ics: Vec<usize>
§data: Vec<f64>
Implementations§
source§impl SPMatrix
impl SPMatrix
pub fn new(row: usize, col: usize, nnz: usize) -> Self
pub fn from_dense(m: &Matrix) -> Self
pub fn to_dense(&self) -> Matrix
pub fn col_ptr(&self) -> &Vec<usize>
pub fn row_ics(&self) -> &Vec<usize>
pub fn data(&self) -> &Vec<f64>
pub fn transpose(&self) -> Self
pub fn t(&self) -> Self
Trait Implementations§
source§impl LinearAlgebra<Matrix> for SPMatrix
impl LinearAlgebra<Matrix> for SPMatrix
Linear algebra for sparse matrix
Caution : In every ops in this trait, there is converting process to dense matrix
fn back_subs(&self, _b: &[f64]) -> Vec<f64>
fn forward_subs(&self, _b: &[f64]) -> Vec<f64>
fn lu(&self) -> PQLU<Matrix>
fn waz(&self, _d_form: Form) -> Option<WAZD<Matrix>>
fn qr(&self) -> QR<Matrix>
fn svd(&self) -> SVD<Matrix>
fn cholesky(&self, _uplo: UPLO) -> Matrix
fn rref(&self) -> Matrix
fn det(&self) -> f64
fn block(&self) -> (Matrix, Matrix, Matrix, Matrix)
fn inv(&self) -> Matrix
fn pseudo_inv(&self) -> Matrix
fn solve(&self, _b: &[f64], _sk: SolveKind) -> Vec<f64>
fn solve_mat(&self, _m: &Matrix, _sk: SolveKind) -> Matrix
fn is_symmetric(&self) -> bool
source§impl<'a, 'b> Mul<&'b Vec<f64>> for &'a SPMatrix
impl<'a, 'b> Mul<&'b Vec<f64>> for &'a SPMatrix
Reference version of matrix multiplication with vector
Auto Trait Implementations§
impl Freeze for SPMatrix
impl RefUnwindSafe for SPMatrix
impl Send for SPMatrix
impl Sync for SPMatrix
impl Unpin for SPMatrix
impl UnwindSafe for SPMatrix
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more