# SuiteSparseMatrix¶

class probnum.problems.zoo.linalg.SuiteSparseMatrix(matid, group, name, nnz, is2d3d, isspd, psym, nsym, kind)

SuiteSparse Matrix.

Sparse matrix from the SuiteSparse Matrix Collection. 1 2

Parameters

References

1

Davis, TA and Hu, Y. The University of Florida sparse matrix collection. ACM Transactions on Mathematical Software (TOMS) 38.1 ( 2011): 1-25.

2

Kolodziej, Scott P., et al. The SuiteSparse matrix collection website interface. Journal of Open Source Software 4.35 (2019): 1244.

Attributes Summary

 H rtype LinearOperator T rtype LinearOperator dtype rtype dtype is_square rtype bool ndim rtype int shape rtype

Methods Summary

 __call__(x[, axis]) Call self as a function. rtype LinearOperator astype(dtype[, order, casting, subok, copy]) rtype LinearOperator broadcast_matmat(matmat) rtype broadcast_matvec(matvec) rtype broadcast_rmatmat(rmatmat) rtype broadcast_rmatvec(rmatvec) rtype cond([p]) Compute the condition number of the linear operator. rtype LinearOperator rtype LinearOperator Determinant of the linear operator. Eigenvalue spectrum of the linear operator. from_database_entry(database_entry) Create a SuiteSparseMatrix object from an entry of the database index. Inverse of the linear operator. Log absolute determinant of the linear operator. Rank of the linear operator. todense([cache]) Dense matrix representation of the linear operator. Trace of the linear operator. Transpose this linear operator.

Attributes Documentation

H
Return type

LinearOperator

T
Return type

LinearOperator

dtype
Return type

dtype

is_square
Return type

bool

ndim
Return type

int

shape
Return type

Methods Documentation

__call__(x, axis=None)

Call self as a function.

Return type

ndarray

adjoint()
Return type

LinearOperator

astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
Return type

LinearOperator

classmethod broadcast_matmat(matmat)
Return type
classmethod broadcast_matvec(matvec)
Return type
classmethod broadcast_rmatmat(rmatmat)
Return type
classmethod broadcast_rmatvec(rmatvec)
Return type
cond(p=None)

Compute the condition number of the linear operator.

The condition number of the linear operator with respect to the p norm. It measures how much the solution $$x$$ of the linear system $$Ax=b$$ changes with respect to small changes in $$b$$.

Parameters

p ({None, 1, , 2, , inf, 'fro'}, optional) –

Order of the norm:

p

norm for matrices

None

2-norm, computed directly via singular value decomposition

’fro’

Frobenius norm

np.inf

max(sum(abs(x), axis=1))

1

max(sum(abs(x), axis=0))

2

2-norm (largest sing. value)

Returns

The condition number of the linear operator. May be infinite.

Return type

cond

conj()
Return type

LinearOperator

conjugate()
Return type

LinearOperator

det()

Determinant of the linear operator.

Return type

inexact

eigvals()

Eigenvalue spectrum of the linear operator.

Return type

ndarray

classmethod from_database_entry(database_entry)[source]

Create a SuiteSparseMatrix object from an entry of the database index.

Parameters

database_entry (Dict) – Dictionary representing one entry from the SuiteSparse database index.

Return type

SuiteSparseMatrix

inv()

Inverse of the linear operator.

Return type

LinearOperator

logabsdet()

Log absolute determinant of the linear operator.

Return type

inexact

rank()

Rank of the linear operator.

Return type

int64

todense(cache=True)

Dense matrix representation of the linear operator.

This method can be computationally very costly depending on the shape of the linear operator. Use with caution.

Returns

matrix – Matrix representation of the linear operator.

Return type

np.ndarray

trace()

Trace of the linear operator.

Computes the trace of a square linear operator $$\text{tr}(A) = \sum_{i-1}^n A_ii$$.

Returns

trace – Trace of the linear operator.

Return type

float

:raises LinAlgError : If trace() is called on a non-square matrix.:

transpose()

Transpose this linear operator.

Can be abbreviated self.T instead of self.transpose().

Return type

LinearOperator