KmlDssGenClean?I
Interface Definition
C interface:
int KmlDssGenCleanSI(KmlSolverTask **pHandle);
int KmlDssGenCleanDI(KmlSolverTask **pHandle);
int KmlDssGenCleanCI(KmlSolverTask **pHandle);
int KmlDssGenCleanZI(KmlSolverTask **pHandle);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
pHandle |
KmlSolverTask ** |
Solver handle, which transfers a variable defined previously. |
Input/Output |
Return Values
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_NULL_ARGUMENT |
int |
Invalid parameter. |
KMLSS_BAD_HANDLE |
int |
The format of pHandle is incorrect. |
Dependency
#include "kml_dss.h" or #include "kml_solver.h"
Example
C interface:
int n = 8;
int ia[9] = {0, 2, 4, 6, 8, 10, 12, 13, 14};
int ja[14] = {0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 7};
double a[14] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0};
double b[8] = {3.0, 7.0, 13.0, 19.0, 25.0, 31.0, 23.0, 26.0};
double x[8];
KmlSolverTask* matrix_handle = NULL;
int ierr = KmlDssGenInitDI(&matrix_handle, n, a, ja, ia);
if (ierr != 0) {
printf("\nERROR in KmlDssGenInitDI: %d", ierr);
}
ierr = KmlDssGenAnalyzeDI(&matrix_handle);
if (ierr != 0) {
printf("\nERROR in KmlDssGenAnalyzeDI: %d", ierr);
}
ierr = KmlDssGenFactorizeDI(&matrix_handle);
if (ierr != 0) {
printf("\nERROR in KmlDssGenFactorizeDI: %d", ierr);
}
ierr = KmlDssGenSolveDI(&matrix_handle, nrhs, x, ldx, b, ldb);
if (ierr != 0) {
printf("\nERROR in KmlDssGenSolveDI: %d", ierr);
}
ierr = KmlDssGenCleanDI(&matrix_handle);
if (ierr != 0) {
printf("\nERROR in KmlDssGencleanDI: %d", ierr);
}
Parent topic: LU