cupyx.scipy.sparse.spmatrix#
- class cupyx.scipy.sparse.spmatrix(*args, maxprint=50, **kwargs)[source]#
Mixin for sparse matrix classes.
Sparse matrix classes follow legacy
numpy.matrixsemantics:*is matrix multiplication and**is matrix power. Provides backward-compatibility methods (.A,.H,getrow,getcol, etc.) that do not exist on sparse arrays. These APIs are deprecated in favor of the sparse array interface.See also
Methods
- asfptype()[source]#
Upcasts matrix to a floating point format.
When the matrix has floating point type, the method returns itself. Otherwise it makes a copy with floating point type and the same format.
- Returns:
A matrix with float type.
- Return type:
- getcol(j)[source]#
Return a copy of column
jas a (m x 1) sparse column vector.Matrix-only API; for sparse arrays use
A[:, j](orA[:, [j]]for a 2-D result).
- getnnz(axis=None)[source]#
Number of stored values, including explicit zeros.
- Parameters:
axis (None, 0, or 1) – Select between the number of values across the whole matrix, in each column (axis=0), or in each row (axis=1).
- getrow(i)[source]#
Return a copy of row
ias a (1 x n) sparse row vector.Matrix-only API; for sparse arrays use
A[i](orA[[i], :]for a 2-D result).
- __eq__(value, /)#
Return self==value.
- __ne__(value, /)#
Return self!=value.
- __lt__(value, /)#
Return self<value.
- __le__(value, /)#
Return self<=value.
- __gt__(value, /)#
Return self>value.
- __ge__(value, /)#
Return self>=value.
Attributes
- A#
Dense ndarray representation of this matrix.
Deprecated since version 15.0: Use
toarray()instead.
- H#
Hermitian (conjugate) transpose of this matrix.
Deprecated since version 15.0: Use
.T.conj()instead.
- shape#
Shape of the matrix.