Rate This Document
Findability
Accuracy
Completeness
Readability

KmlDssGenFactorize?I

Implement LU decomposition of a general matrix.

Interface Definition

C interface:

int KmlDssGenFactorizeSI(KmlSolverTask **pHandle);

int KmlDssGenFactorizeDI(KmlSolverTask **pHandle);

int KmlDssGenFactorizeCI(KmlSolverTask **pHandle);

int KmlDssGenFactorizeZI(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

C interface:
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);
}
ierr = KmlDssGenFactorizeDI(&handle);
if (ierr != 0) {
    printf("\nERROR in KmlDssGenFactorizeDI: %d", ierr);
}