SparseMatrix
Represents a sparse matrix using the Compressed Sparse Row (CSR) format.
The CSR format stores a sparse matrix using three arrays:
values: stores the non-zero values of the matrix
columnIndices: stores the column indices of the non-zero values
rowPointers: stores the starting position of each row in the values array
This format is memory-efficient for sparse matrices where most elements are zero.
Constructors
Properties
Functions
Creates a copy of this sparse matrix.
Extracts the main diagonal of this sparse matrix.
Calculates the Frobenius norm of the sparse matrix. The Frobenius norm is the square root of the sum of the squares of all the non-zero elements in the matrix.
Checks if this sparse matrix is symmetric within a specified tolerance.
Extension function to subtract a SparseMatrix from another SparseMatrix.
Extension function to subtract a Matrix from a SparseMatrix.
Returns the number of non-zero elements in this sparse matrix.
Extension function to add two SparseMatrices.
Adds this sparse matrix to another matrix and returns the resulting matrix.
Finds the count smallest eigenpairs of this symmetric positive-semidefinite sparse matrix, using shift-invert Lanczos: builds one Krylov subspace for the operator v -> solve(this, v) (via SparseMatrix.solveCG) -- which maps this matrix's smallest eigenvalues to its largest, the ones Lanczos converges to fastest -- and extracts Ritz pairs from the resulting small, dense tridiagonal eigenproblem.
Solves the symmetric positive-definite system this * x = b using the Jacobi-preconditioned conjugate gradient method.
Multiplies this sparse matrix by a scalar value.
Multiplies this sparse matrix with another sparse matrix and returns the resulting sparse matrix.
Multiplies this sparse matrix with a dense vector.
Multiplies this sparse matrix with another matrix and returns the resulting matrix.
Creates a dense Matrix representation of this sparse matrix.
Creates a transposed version of this sparse matrix.