AMDInfo

class sksparse.amd.AMDInfo(status: int, N: int, nz: int, symmetry: float, nzdiag: int, nz_A_plus_AT: int, Ndense: int, memory: float, Ncmpa: int, Lnz: int, Ndiv: int, Nmultsubs_LDL: int, Nmultsubs_LU: int, dmax: int)[source]

Information statistics returned by the AMD algorithm.

This class wraps the contents of the Info array output by amd_order() into a Python dataclass.

status[source]
Return status:
  • 0 = OK,

  • 1 = OK but jumbled,

  • -1 = out of memory,

  • -2 = invalid matrix.

Type:

int

N[source]

Number of rows and columns of the input matrix A.

Type:

int

nz[source]

Number of nonzeros in the input matrix A.

Type:

int

symmetry[source]

Symmetry of pattern of A. The symmetry is the number of “matched” off-diagonal entries divided by the total number of off-diagonal entries. An entry A[i, j] is matched if A[j, i] is also an entry, for any pair [i, j] where i != j. In python code:

S = A.astype(bool)
B = sparse.tril(S, -1) + sparse.triu(S, 1)
symmetry = (B * B.T).nnz / B.nnz
Type:

float \(\in [0, 1]\)

nzdiag[source]

Number of entries on the diagonal of A.

Type:

int

nz_A_plus_AT[source]

Number of nonzeros in A + A.T (excluding diagonal). If A is perfectly symmetric (symmetry = 1), with a fully non-zero diagonal, then nz_A_plus_AT = nz - N (the smallest possible value). If A is perfectly unsymmetric (symmetry = 0, for an upper triangular matrix, e.g.) with no diagonal, then nz_A_plus_AT = 2 * nz (the largest possible value).

Type:

int

Ndense[source]

Number of dense rows/columns ignored during ordering. These rows/columns are placed last in the output order p.

Type:

int

memory[source]

Memory used, in bytes. This is equal to: (1.2 * nz_A_plus_AT + 9 * N) * sizeof(int). This coefficient is at most 2.4 * nz + 9 * N. This accounting excludes the size of the input arguments Ap, Ai, and p, which have a total size of nz + 2 * N + 1 integers.

Type:

float

Ncmpa[source]

Number of components in the matrix (excluding dense rows/columns).

Type:

int

Lnz[source]

Number of nonzeros in the Cholesky factor L of A, excluding the diagonal. This is a slight upper bound because of the approximate degree algorithm. It is a rough upper bound if there are many dense rows/columns. The remaining statistics are also slight or rough upper bounds for the same reason.

Type:

int

Ndiv[source]

Number of division operations for LU or Cholesky factorization of the permuted matrix A[p][:, p].

Type:

int

Nmultsubs_LDL[source]

Number of multiply-subtract pairs for LDL.T factorization.

Type:

int

Nmultsubs_LU[source]

Number of multiply-subtract pairs for LU factorization, assuming that no numerical pivoting is required.

Type:

int

dmax[source]

Maximum number of nonzeros in any column of L, including the diagonal.

Type:

int

Notes

Field descriptions are adapted from SuiteSparse amd.h [1].

Added in version 0.5.0.

References

Methods