|
|
◆ CsrCheck()
| Sub CsrCheck |
( |
M As |
Long, |
|
|
N As |
Long, |
|
|
Val() As |
Double, |
|
|
Ptr() As |
Long, |
|
|
Ind() As |
Long, |
|
|
Result() As |
Long, |
|
|
Info As |
Long |
|
) |
| |
Check sparse matrix (CSR)
- Purpose
- This routine checks the sparse matrix in CSR format.
- Parameters
-
| [in] | M | Number of rows of the matrix. (M >= 0) (If M = 0, returns without computation) |
| [in] | N | Number of columns of the matrix. (N >= 0) (If N = 0, returns without computation) |
| [in] | Val() | Array Val(LVal - 1) (LVal >= Nnz) (Nnz is the number of nonzero elements of the matrix)
Values of nonzero elements of the matrix. |
| [in] | Ptr() | Array Ptr(LPtr - 1) (LPtr >= M + 1)
Row pointers of the matrix. |
| [in] | Ind() | Array Ind(LInd - 1) (LInd >= Nnz) (Nnz is the number of nonzero elements of the matrix)
Column indices of the matrix. |
| [out] | Result() | Array Result(LResult - 1) (LResult >= 10)
Check result (valid for 0 <= info <= 15).
Result(0): Symmetry (0: nonsymmetric matrix, 1: symmetric matrix)
Result(1): Number of nonzero elements. (= Ptr(M) - Ptr(0))
Result(2): Number of nonzero elements in lower triangular part.
Result(3): Number of nonzero elements in upper triangular part.
Result(4): Number of nonzero diagonal elements.
Result(5): Number of elements with zero values (Val = 0).
Result(6): Number of diagonal elements with zero values (Val = 0).
Result(7): Number of empty rows.
Result(8): Number of rows with unsorted column indices.
Result(9): Number of invaid column indices. |
| [out] | Info | = 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= 1: Empty row(s) found.(*)
= 2: Row(s) with unsorted column indices found.(*)
= 4: Diagonal element(s) with zero values (Val = 0) found.(*)
= 8: Invalid column index(es) found.(*)
(*) Sum of these codes will be returned (e.g. 15 = 1 + 2 + 4 + 8 indicates that all four cases were detected).
= 16: The value of Ptr(0) is invalid.
= 17: The value of (Ptr(M) - Ptr(0)) is invalid.
= 18: the value(s) of Ptr(i)(i > 0) are invalid. |
|