XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ csc_check()

void csc_check ( int  m,
int  n,
const double  val[],
const int  ptr[],
const int  ind[],
int  result[],
int *  info 
)

Check sparse matrix (CSC)

Purpose
This routine checks the sparse matrix in CSC format. Use separate routine csx_check_sym to check symmetry.
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] (lval >= nnz) (nnz is the number of nonzero elements of input matrix)
Values of nonzero elements of input matrix.
[in]ptr[]Array ptr[lptr] (lptr >= m + 1)
Column pointers of input matrix.
[in]ind[]Array ind[lind] (lind >= nnz) (nnz is the number of nonzero elements of input matrix)
Row indices of input matrix.
[out]result[]Array result[lresult] (lresult >= 10)
Check result (valid for 0 <= info <= 15).
result[0]: Indexing of ptr[] and ind[] (0 or 1). (base = ptr[0])
result[1]: Number of nonzero elements. (nnz = ptr[m] - ptr[0])
result[2]: Number of nonzero elements in lower triangular part. (nnz_lower)
result[3]: Number of nonzero elements in upper triangular part. (nnz_upper)
result[4]: Number of nonzero diagonal elements. (nnz_diag)
result[5]: Number of elements with zero values (val[i] = 0). (n_zero)
result[6]: Number of diagonal elements with zero values (val[i] = 0). (n_zero_diag)
result[7]: Number of empty columns. (empty_cols)
result[8]: Number of columns with unsorted row indices. (unsorted_cols)
result[9]: Number of invaid row indices. (invalid_inds)
[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.