pub struct ComplexCsrMatrix {
pub nrows: usize,
pub ncols: usize,
pub indptr: Vec<usize>,
pub indices: Vec<usize>,
pub data: Vec<Complex<f64>>,
}Expand description
A complex sparse matrix in compressed sparse row form, with the column indices of each row increasing.
Fields§
§nrows: usize§ncols: usize§indptr: Vec<usize>§indices: Vec<usize>§data: Vec<Complex<f64>>Implementations§
Source§impl ComplexCsrMatrix
impl ComplexCsrMatrix
Sourcepub fn from_triplets(
nrows: usize,
ncols: usize,
rows: &[usize],
cols: &[usize],
values: &[Complex<f64>],
) -> Result<Self>
pub fn from_triplets( nrows: usize, ncols: usize, rows: &[usize], cols: &[usize], values: &[Complex<f64>], ) -> Result<Self>
Builds a matrix from triplets, summing duplicates (SciPy’s coo_array(...).tocsr()).
Sourcepub fn from_real_imag(real: &CsrMatrix, imag: &CsrMatrix) -> Result<Self>
pub fn from_real_imag(real: &CsrMatrix, imag: &CsrMatrix) -> Result<Self>
The matrix real + i·imag of two real sparse matrices of the same shape.
Sourcepub fn from_dense(a: &Array2<Complex<f64>>, tol: f64) -> Self
pub fn from_dense(a: &Array2<Complex<f64>>, tol: f64) -> Self
From a dense matrix, keeping the entries of modulus above tol.
pub fn nnz(&self) -> usize
pub fn to_dense(&self) -> Array2<Complex<f64>>
Sourcepub fn transpose(&self) -> ComplexCsrMatrix
pub fn transpose(&self) -> ComplexCsrMatrix
The transpose Aᵀ.
Sourcepub fn adjoint(&self) -> ComplexCsrMatrix
pub fn adjoint(&self) -> ComplexCsrMatrix
The conjugate transpose Aᴴ.
Sourcepub fn conj(&self) -> ComplexCsrMatrix
pub fn conj(&self) -> ComplexCsrMatrix
The complex conjugate Ā.
Sourcepub fn add(
&self,
alpha: Complex<f64>,
other: &ComplexCsrMatrix,
beta: Complex<f64>,
) -> Result<ComplexCsrMatrix>
pub fn add( &self, alpha: Complex<f64>, other: &ComplexCsrMatrix, beta: Complex<f64>, ) -> Result<ComplexCsrMatrix>
α A + β B for matrices of the same shape.
Sourcepub fn matmul(&self, b: &ComplexCsrMatrix) -> Result<ComplexCsrMatrix>
pub fn matmul(&self, b: &ComplexCsrMatrix) -> Result<ComplexCsrMatrix>
The product A B.
Trait Implementations§
Source§impl Clone for ComplexCsrMatrix
impl Clone for ComplexCsrMatrix
Source§impl Debug for ComplexCsrMatrix
impl Debug for ComplexCsrMatrix
Source§impl PartialEq for ComplexCsrMatrix
impl PartialEq for ComplexCsrMatrix
impl StructuralPartialEq for ComplexCsrMatrix
Auto Trait Implementations§
impl Freeze for ComplexCsrMatrix
impl RefUnwindSafe for ComplexCsrMatrix
impl Send for ComplexCsrMatrix
impl Sync for ComplexCsrMatrix
impl Unpin for ComplexCsrMatrix
impl UnsafeUnpin for ComplexCsrMatrix
impl UnwindSafe for ComplexCsrMatrix
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