KmlDss(Spd/Hpd)Get?IL
Obtain handle-related long integer values.
Interface Definition
C interfaces:
int KmlDssSpdGetSIL(KmlSolverTask **pHandle, enum KmlSolverParam param, int64_t *value, int nvalue);
int KmlDssSpdGetDIL(KmlSolverTask **pHandle, enum KmlSolverParam param, int64_t *value, int nvalue);
int KmlDssHpdGetCIL(KmlSolverTask **pHandle, enum KmlSolverParam param, int64_t *value, int nvalue);
int KmlDssHpdGetZIL(KmlSolverTask **pHandle, enum KmlSolverParam param, int64_t *value, int nvalue);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
pHandle |
KmlSolverTask ** |
Solver handle. pHandle cannot be a null pointer. |
Input |
param |
enum KmlSolverParam |
KMLSS_FILL_IN indicates the number of fill-in elements. |
Input |
value |
int64_t * |
Array containing parameters related to direct solution methods. |
Output |
nvalue |
int |
Number of elements in the value array. Currently, the number must be 1. |
Input |
Return Value
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_NULL_ARGUMENT |
int |
The pHandle or data pointer is null. |
KMLSS_BAD_HANDLE |
int |
The format of pHandle is incorrect. |
KMLSS_BAD_DATA_SIZE |
int |
The user-defined length (nvalue) of the value array is improper. |
KMLSS_INTERNAL_ERROR |
int |
Failed to obtain KMLSS_FILL_IN because the pHandle status is abnormal. |
KMLSS_BAD_SELECTOR |
int |
The input value of KML_SOLVER_PARAM is not supported currently or does not exist during the solving process. |
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 b[2] = {3,1};
double x[2];
int nrhs = 1;
int ldx = n, ldb = n;
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);
}
ierr = KmlDssSpdSolveDI(&handle, nrhs, x, ldx, b, ldb);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdSolveDI: %d", ierr);
}
int64_t nnz;
ierr = KmlDssSpdGetDIL(&handle, KMLSS_FILL_IN, &nnz, 1);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdGetDIL: %d", ierr);
}
printf("NNZ = %lld\n", nnz);
NNZ = 4