KmlDssSymFactorize?I
Perform LDLT decomposition on a symmetric indefinite matrix.
Interface Definition
C interface:
int KmlDssSymFactorizeSI(KmlSolverTask **pHandle);
int KmlDssSymFactorizeDI(KmlSolverTask **pHandle);
int KmlDssSymFactorizeCI(KmlSolverTask **pHandle);
int KmlDssSymFactorizeZI(KmlSolverTask **pHandle);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
pHandle |
KmlSolverTask ** |
Solver handle, which transfers a variable defined previously |
Input |
Return Value
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 parameter is invalid or its format is incorrect. |
KMLSS_INVALID_CALL_ORDER |
int |
The calling sequence is incorrect and the decomposition phase is skipped. |
KMLSS_NO_MEMORY |
int |
Failed to allocate memory. |
KMLSS_INTERNAL_ERROR |
int |
An internal error occurs during algorithm execution. |
Dependencies
#include "kml_dss.h" or #include "kml_solver.h"
Examples
int n = 8;
int ia[9] = {0, 2, 4, 6, 7, 8, 9, 10, 11};
int ja[11] = {0, 7, 1, 6, 2, 5, 3, 4, 5, 6, 7};
double a[11] = {1.0, 2.0, -2.0, 3.0, 3.0, 4.0, -4.0, 5.0, -6.0, 7.0, 8.0};
KmlSolverTask *handle;
int ierr = KmlDssSymInitDI(&handle, n, a, ja, ia);
if (ierr != 0) {
printf("\nERROR in KmlDssSymInitDI: %d", ierr);
}
ierr = KmlDssSymAnalyzeDI(&handle);
if (ierr != 0) {
printf("\nERROR in KmlDssSymAnalyzeDI: %d", ierr);
}
ierr = KmlDssSymFactorizeDI(&handle);
if (ierr != 0) {
printf("\nERROR in KmlDssSymFactorizeDI: %d", ierr);
}
for (int i = 0; i < n; i++) {
printf("%lf ", x[i]);
}