CAMDInfo¶
- class sksparse.camd.CAMDInfo(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 CAMD algorithm.
This class wraps the contents of the
Infoarray output bycamd_order()into a Python dataclass.- status[source]¶
- Return status:
0 = OK,
1 = OK but jumbled,
-1 = out of memory,
-2 = invalid matrix.
- Type:
- 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 entryA[i, j]is matched ifA[j, i]is also an entry, for any pair[i, j]wherei != 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]\)
- nz_A_plus_AT[source]¶
Number of nonzeros in
A + A.T(excluding diagonal). IfAis perfectly symmetric (symmetry = 1), with a fully non-zero diagonal, thennz_A_plus_AT = nz - N(the smallest possible value). IfAis perfectly unsymmetric (symmetry = 0, for an upper triangular matrix, e.g.) with no diagonal, thennz_A_plus_AT = 2 * nz(the largest possible value).- Type:
- Ndense[source]¶
Number of dense rows/columns ignored during ordering. These rows/columns are placed last in the output order
p.- Type:
- memory[source]¶
Memory used, in bytes. This is equal to:
(1.2 * nz_A_plus_AT + 9 * N) * sizeof(int). This coefficient is at most2.4 * nz + 9 * N. This accounting excludes the size of the input argumentsAp,Ai, andp, which have a total size ofnz + 2 * N + 1integers.- Type:
- Lnz[source]¶
Number of nonzeros in the Cholesky factor
LofA, 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:
- Ndiv[source]¶
Number of division operations for LU or Cholesky factorization of the permuted matrix
A[p][:, p].- Type:
- Nmultsubs_LU[source]¶
Number of multiply-subtract pairs for LU factorization, assuming that no numerical pivoting is required.
- Type:
Notes
Field descriptions are adapted from SuiteSparse
camd.h[1].Added in version 0.5.0.
References
Methods