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

◆ dgssv()

void dgssv ( char  col_perm,
double  thresh,
char  sym_mode,
int  n,
const double  val[],
const int  ptr[],
const int  ind[],
int  format,
int  base,
int  perm_c[],
int  perm_r[],
int  nrhs,
int  ldb,
double  b[],
double *  rcond,
int *  info 
)

Solves the system of linear equations A*X = B (sparse matrix, direct method (SuperLU)) (simple driver)

Purpose
This routine solves the system of linear equations A*X = B, using the LU factorization, where A is a general N x N sparse matrix. It performs the following steps:

  1. If A is stored column-wise (CSC):

    1.1. Permute the columns of A, forming A*Pc, where Pc is a permutation matrix.
    1.2. Factor A as Pr*A*Pc = L*U with the permutation Pr determined by Gaussian elimination with partial pivoting. L is unit lower triangular with offdiagonal entries bounded by 1 in magnitude, and U is upper triangular.
    1.3. Solve the system of equations A*X = B using the factored form of A.

  2. If A is stored row-wise (CSR), apply the above algorithm to the transpose of A:

    2.1. Permute columns of transpose(A) (rows of A), forming transpose(A)*Pc, where Pc is a permutation matrix.
    2.2. Factor A as Pr*transpose(A)*Pc = L*U with the permutation Pr determined by Gaussian elimination with partial pivoting. L is unit lower triangular with offdiagonal entries bounded by 1 in magnitude, and U is upper triangular.
    2.3. Solve the system of equations A*X = B using the factored form of A.
Parameters
[in]col_permSpecifies the type of column ordering to reduce fill-in.
= 'A': Approximate minimum degree (AMD) ordering.
= 'N': Natural ordering (No ordering) (Pc = I).
= 'M': Multiple minimum degree (MMD) ordering on A^T*A.
= 'P': Multiple minimum degree (MMD) ordering on A^T + A.
= 'U': User specified ordering.
[in]threshSpecifies the threshold used for a diagonal entry to be an acceptable pivot. (0 <= thresh <= 1)
[in]sym_modeSpecifies whether to use symmetric mode. Symmetric mode gives preference to diagonal pivots, and uses an (A^T + A)-based column permutation algorithm.
= 'N': Do not use symmetric mode.
= 'S': Use symmetric mode.
[in]nDimension of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]val[]Array val[lval] (lval >= nnz)
Values of nonzero elements of the matrix A in CSC/CSR format (where nnz is the number of nonzero elements).
[in]ptr[]Array ptr[lptr] (lptr >= n + 1)
Column/row pointers of the matrix A in CSC/CSR format.
[in]ind[]Array ind[lind] (lind >= nnz)
Row/column indices of the matrix A in CSC/CSR format (where nnz is the number of nonzero elements).
[in]formatSparse matrix format.
= 0: CSR format.
= 1: CSC format.
[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,out]perm_c[]Array perm_c[lperm_c] (lperm_c >= n)
[in] Input permutation vector if option col_perm = 'U'. Otherwise, an output argument.
[out] In the case of CSC format, column permutation vector which defines the permutation matrix Pc. perm_c[i] = j means column i of A is in position j in A*Pc. Similarly, in the case of CSR, column permutation vector which describes permutation of columns of A^T (rows of A).
Input permutation vector may be overwritten by the product of the input perm_c[] and a permutation that postorders the elimination tree of Pc^T*A^T*A*Pc. perm_c[] is not changed if the elimination tree is already in postorder.
[out]perm_r[]Array perm_r[lperm_r] (lperm_r >= n)
In the case of CSC format, row permutation vector which defines the permutation matrix Pr, and is determined by partial pivoting. perm_r[i] = j means row i of A is in position j in Pr*A. In the case of CSR format, permutation vector which determines permutation of rows of A^T (columns of A) as described above.
[in]nrhsNumber of right hand sides, i.e., number of columns of the matrix B. (nrhs >= 0) (If nrhs = 0, returns without computation)
[in]ldbLeading dimension of the two dimensional array b[][]. (ldb >= max(0, n))
[in,out]b[][]Array b[lb][ldb] (lb >= nrhs)
[in] Right hand side matrix B.
[out] Solution matrix X.
[out]rcondEstimated reciprocal of the condition number of the matrix A.
[out]info= 0: Successful exit.
< 0: The (-info)-th argument is invalid.
= -10000: Unrecoverble error occured in SuperLU routine.
= i > 0 and <= n: U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed.
= i > n: Memory allocation failure occurred. i - n is the number of bytes allocated.
Reference
SuperLU