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

◆ CsxDiagInd()

Sub CsxDiagInd ( M As  Long,
N As  Long,
Ptr() As  Long,
Ind() As  Long,
Id() As  Long,
Optional Info As  Long,
Optional Base As  Long = -1 
)

Indices to diagonal elements of sparse matrix (CSC/CSR)

Purpose
This routine stores the indices to diagonal elements of CSC or CSR sparse matrix into the array Id().
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]Ptr()Array Ptr(LPtr - 1) (LPtr >= N + 1 (CSC), LPtr >= M + 1 (CSR))
Column pointers (if CSC) or row pointers (if CSR) of the matrix.
[in]Ind()Array Ind(LInd - 1) (LInd >= Nnz)
Row indices (if CSC) or column indices (if CSR) of the matrix.
[out]Id()Array D(LD - 1) (LD >= min(M, N))
Indices to diagonal elements (i = 0 to min(m, n) - 1). If diagonal element is not found, -1 is stored.
[out]Info(Optional)
= 0: Successful exit.
= i < 0: The (-i)-th argument is invalid or has an illegal value.
= j > 0: The j diagonal elements are not found.
[in]Base(Optional)
Indexing of Ptr() and Ind().
= 0: Zero-based (C style) indexing: Starting index is 0.
= 1: One-based (Fortran style) indexing: Starting index is 1.
(default: Assumes 1 if Ptr(0) = 1, 0 otherwise)