KmlDssGenClean?I
释放内部数据结构,将Handle指向空指针。
接口定义
C Interface:
int KmlDssGenCleanSI(KmlSolverTask **pHandle);
int KmlDssGenCleanDI(KmlSolverTask **pHandle);
int KmlDssGenCleanCI(KmlSolverTask **pHandle);
int KmlDssGenCleanZI(KmlSolverTask **pHandle);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
pHandle |
KmlSolverTask ** |
求解器句柄,传入之前步骤的变量。 |
输入/输出 |
返回值
返回值 |
类型 |
描述 |
---|---|---|
KMLSS_NO_ERROR |
int |
正常执行。 |
KMLSS_NULL_ARGUMENT |
int |
无效的参数。 |
KMLSS_BAD_HANDLE |
int |
pHandle格式存在问题。 |
依赖
#include "kml_dss.h"或#include "kml_solver.h"
示例
C Interface:
int n = 8; int ia[9] = {0, 2, 4, 6, 8, 10, 12, 13, 14}; int ja[14] = {0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 7, 6, 7}; double a[14] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0}; double b[8] = {3.0, 7.0, 13.0, 19.0, 25.0, 31.0, 23.0, 26.0}; double x[8]; KmlSolverTask* matrix_handle = NULL; int ierr = KmlDssGenInitDI(&matrix_handle, n, a, ja, ia); if (ierr != 0) { printf("\nERROR in KmlDssGenInitDI: %d", ierr); } ierr = KmlDssGenAnalyzeDI(&matrix_handle); if (ierr != 0) { printf("\nERROR in KmlDssGenAnalyzeDI: %d", ierr); } ierr = KmlDssGenFactorizeDI(&matrix_handle); if (ierr != 0) { printf("\nERROR in KmlDssGenFactorizeDI: %d", ierr); } ierr = KmlDssGenSolveDI(&matrix_handle, nrhs, x, ldx, b, ldb); if (ierr != 0) { printf("\nERROR in KmlDssGenSolveDI: %d", ierr); } ierr = KmlDssGenCleanDI(&matrix_handle); if (ierr != 0) { printf("\nERROR in KmlDssGencleanDI: %d", ierr); }
父主题: LU