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

◆ z_csx_diag()

void z_csx_diag ( int  m,
int  n,
const doublecomplex  val[],
const int  ptr[],
const int  ind[],
int  base,
doublecomplex  alpha,
int  inv,
doublecomplex  d[],
int  incd,
int *  info 
)

Diagonal elements of sparse matrix (Complex matrices) (CSC/CSR)

Purpose
This routine stores the diagonal elements of CSC/CSR sparse matrix into the array d[].
d[i] = α*di or α/di (i = 0 to min(m, n) - 1)
where di is the i-th diagonal element and α is the scalar.
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)
Values of nonzero elements of input matrix (where nnz is the number of nonzero elements).
[in]ptr[]Array ptr[lptr] (lptr >= n + 1)
Column pointers (if CSC) or row pointers (if CSR) of input matrix.
[in]ind[]Array ind[lind] (lind >= nnz)
Row indices (if CSC) or column indices (if CSR) of input matrix (where nnz is the number of nonzero elements).
[in]baseIndexing of ptr[] and ind[].
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
[in]alphaScalar α.
[in]inv= 0: Store α*di in d[i].
!= 0: Store α/di in d[i].
[out]d[]Array d[ld] (ld >= min(m, n))
α*di or α/di (i = 0 to min(m, n) - 1).
[in]incdStorage spacing between elements of d[].
[out]info= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid.
= j > 0: The j diagonal elements are not found (Returns 0 in d[] for such elements).