KmlDssGenAnalyze?I
Analyze the data structure, rearrange the sparse matrix, and perform symbolic factorization.
Interface Definition
C interface:
int KmlDssGenAnalyzeSI(KmlSolverTask **pHandle);
int KmlDssGenAnalyzeDI(KmlSolverTask **pHandle);
int KmlDssGenAnalyzeCI(KmlSolverTask **pHandle);
int KmlDssGenAnalyzeZI(KmlSolverTask **pHandle);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
pHandle |
KmlSolverTask ** |
Solver handle, which transfers a variable defined previously. |
Input |
Return Values
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_NULL_ARGUMENT |
int |
The pHandle pointer is null. |
KMLSS_BAD_HANDLE |
int |
The format of pHandle is incorrect. |
KMLSS_NONZERO_INDEXING |
int |
The row index pointer does not start from 0. That is, ia[0] is not 0. |
KMLSS_MISSING_DIAGONAL_ELEMENT |
int |
All diagonal elements of the sparse matrix are empty. |
KMLSS_INTERNAL_ERROR |
int |
Empty diagonal elements exist in the sparse matrix or an internal error occurs during algorithm execution. |
KMLSS_REORDERING_PROBLEM |
int |
The reordering algorithm fails. |
Dependency
#include "kml_dss.h" or #include "kml_solver.h"
Example
int n = 8;
int ia[9] = {0, 2, 4, 6, 7, 8, 10, 12, 14};
int ja[14] = {0, 7, 1, 6, 2, 5, 3, 4, 2, 5, 1, 6, 0, 7};
double a[14] = {1.0, 2.0, -2.0, 3.0, 3.0, 4.0, -4.0, 5.0, 4.0, -6.0, 3.0, 7.0, 2.0, 8.0};
KmlSolverTask *handle;
int ierr = KmlDssGenInitDI(&handle, n, a, ja, ia);
if (ierr != 0) {
printf("\nERROR in KmlDssGenInitDI: %d", ierr);
}
ierr = KmlDssGenAnalyzeDI(&handle);
if (ierr != 0) {
printf("\nERROR in KmlDssGenAnalyzeDI: %d", ierr);
}