fulqrum.core.CSRLinearOperator¶
- class CSRLinearOperator(*args, **kwargs)[source]¶
A SciPy LinearOperator wrapper for a CSR array. Allows for parallel computation of the sparse-matrix vector product needed for eigensolving.
Methods
matvec(x)Matrix-vector multiplication.
Attributes
HHermitian adjoint.
TTranspose this linear operator.
An estimate of the raw memory size of the underlying CSR array in bytes
ndimNumber of nonzero elements in the underlying CSR matrix
- matvec(x)[source]¶
Matrix-vector multiplication.
Performs the operation y=A@x where A is an MxN linear operator and x is a column vector or 1-d array.
- Parameters:
x ({matrix, ndarray}) – An array with shape (N,) or (N,1).
- Returns:
y – A matrix or ndarray with shape (M,) or (M,1) depending on the type and shape of the x argument.
- Return type:
{matrix, ndarray}
Notes
This matvec wraps the user-specified matvec routine or overridden _matvec method to ensure that y has the correct shape and type.
- property memory_size¶
An estimate of the raw memory size of the underlying CSR array in bytes
- Returns:
Memory size in bytes
- Return type:
int
- property nnz¶
Number of nonzero elements in the underlying CSR matrix
- Returns:
int