Rate This Document
Findability
Accuracy
Completeness
Readability

KmlDssSymInit?I

Initialize the data structure and associate a provided coefficient matrix with the solution system. The upper triangular part of the matrix in CSR format is used when the LDLT method for a single node is initialized.

Interface Definition

C interface:

int KmlDssSymInitSI(KmlSolverTask **pHandle, int n, float *a, int *ja, int *ia)

int KmlDssSymInitDI(KmlSolverTask **pHandle, int n, double *a, int *ja, int *ia)

int KmlDssSymInitCI(KmlSolverTask **pHandle, int n, kml_complex_float *a, int *ja, int *ia)

int KmlDssSymInitZI(KmlSolverTask **pHandle, int n, kml_complex_double *a, int *ja, int *ia)

Parameters

Parameter

Type

Description

Input/Output

pHandle

KmlSolverTask **

Solver handle. pHandle cannot be a null pointer.

Output

n

int

Dimension of matrix A

Input

a

  • float * in KmlDssSymInitSI
  • double * in KmlDssSymInitDI
  • kml_complex_float * in KmlDssSymInitCI
  • kml_complex_double * in KmlDssSymInitZI

Array whose dimension is the quantity of non-zero elements. a[i] is the value of the i-th non-zero element. The lifecycle of this array is the same as that of pHandle.

Input

ja

int

Array whose dimension is the quantity of non-zero elements. ja[i] is the column number of the i-th non-zero element. The lifecycle of this array is the same as that of pHandle.

Input

ia

int

(n+1)-dimensional array. ia[i] is the index of the first non-zero element in the i-th row in all non-zero elements. The lifecycle of this array is the same as that of pHandle.

Input

Return Value

Return Value

Type

Description

KMLSS_NO_ERROR

int

The execution is successful.

KMLSS_NULL_ARGUMENT

int

A null argument exists in {pHandle, a, ja, ia}.

KMLSS_BAD_N

int

The input matrix dimension is less than or equal to 0.

KMLSS_NO_MEMORY

int

Memory allocation failed.

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, 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);
}