XLPack 7.0
XLPack Numerical Library (Excel VBA) Reference Manual
Loading...
Searching...
No Matches

◆ CscCheck()

Sub CscCheck ( M As  Long,
N As  Long,
Val() As  Double,
Ptr() As  Long,
Ind() As  Long,
Result() As  Long,
Info As  Long 
)

Check sparse matrix (CSC)

Purpose
This routine checks the sparse matrix in CSC format.
Parameters
[in]MNumber of rows of the matrix. (M >= 0) (If M = 0, returns without computation)
[in]NNumber 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 >= N + 1 (CSC), LPtr >= M + 1 (CSR))
Column pointers of the matrix.
[in]Ind()Array Ind(LInd - 1) (LInd >= Nnz) (Nnz is the number of nonzero elements of the matrix)
Row 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 columns .
Result(8): Number of columns with unsorted row indices.
Result(9): Number of invaid row indices.
[out]Info= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= 1: Empty column(s) found.(*)
= 2: Column(s) with unsorted row indices found.(*)
= 4: Diagonal elements with zero values (val = 0) found.(*)
= 8: Invalid row 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.