Rate This Document
Findability
Accuracy
Completeness
Readability

KmlDss(Spd/Hpd)Factorize?I

Apply LLT factorization to a symmetric positive definite matrix or LLH factorization to a Hermitian positive definite matrix.

Interface Definition

C interfaces:

int KmlDssSpdFactorizeSI(KmlSolverTask **pHandle);

int KmlDssSpdFactorizeDI(KmlSolverTask **pHandle);

int KmlDssHpdFactorizeCI(KmlSolverTask **pHandle);

int KmlDssHpdFactorizeZI(KmlSolverTask **pHandle);

Parameters

Parameter

Type

Description

Input/Output

pHandle

KmlSolverTask **

Solver handle, which is a variable passed from a previous step.

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

Incorrect calling sequence: The factorization phase is skipped.

KMLSS_NO_MEMORY

int

Memory allocation failed.

KMLSS_INTERNAL_ERROR

int

An internal error occurs during algorithm execution.

Dependencies

#include "kml_dss.h" or #include "kml_solver.h"

Examples

C interface:
int n = 2;
int ia[3] = {0,2,4};
int ja[4] = {0,1,0,1};
double a[4] = {2,1,1,2};
double x[2];

KmlSolverTask *handle;
int ierr = KmlDssSpdInitDI(&handle, n, a, ja, ia);
if (ierr != 0) {
    printf("\nERROR in KmlDssSpdInitDI: %d", ierr);
}
ierr = KmlDssSpdAnalyzeDI(&handle);
if (ierr != 0) {
    printf("\nERROR in KmlDssSpdAnalyzeDI: %d", ierr);
}
ierr = KmlDssSpdFactorizeDI(&handle);
if (ierr != 0) {
    printf("\nERROR in KmlDssSpdFactorizeDI: %d", ierr);
}
for (int i = 0; i < n; i++) {
    printf("%lf ", x[i]);
}