KmlDss(Spd/Hpd)Init?I
Initialize the data structure and associate a user-provided coefficient matrix with the solver system. The upper triangular part of the matrix in CSR format is used when the LLT or LLH method is initialized.
Interface Definition
C interface:
int KmlDssSpdInitSI(KmlSolverTask **pHandle, int n, float *a, int *ja, int *ia);
int KmlDssSpdInitDI(KmlSolverTask **pHandle, int n, double *a, int *ja, int *ia);
int KmlDssHpdInitCI(KmlSolverTask **pHandle, int n, kml_complex_float *a, int *ja, int *ia);
int KmlDssHpdInitZI(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 |
|
Array whose dimension corresponds to the number 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 corresponds to the number 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 |
Normal execution. |
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 = 2;
int ia[3] = {0,2,4};
int ja[4] = {0,1,0,1};
double a[4] = {2,1,1,2};
KmlSolverTask *handle;
int ierr = KmlDssSpdInitDI(&handle, n, a, ja, ia);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdInitDI: %d", ierr);
}