---
title: KmlDss(Spd/Hpd)Clean?I
description: "释放内部数据结构，将Handle指向空指针。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_0890.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_0890.html
indexId: d80fb5bdd3733f9fdd0c0a220c84476cbb9d30534459f4251f7606a7348f0ec161
---
# KmlDss(Spd/Hpd)Clean?I

释放内部数据结构，将Handle指向空指针。

#### 接口定义

C Interface：

int KmlDssSpdCleanSI(KmlSolverTask **pHandle);

int KmlDssSpdCleanDI(KmlSolverTask **pHandle);

int KmlDssHpdCleanCI(KmlSolverTask **pHandle);

int KmlDssHpdCleanZI(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 = 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* matrix_handle = NULL;
int ierr = KmlDssSpdInitDI(&matrix_handle, n, a, ja, ia);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdInitDI: %d", ierr);
}
ierr = KmlDssSpdAnalyzeDI(&matrix_handle);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdAnalyzeDI: %d", ierr);
}
ierr = KmlDssSpdFactorizeDI(&matrix_handle);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdFactorizeDI: %d", ierr);
}
ierr = KmlDssSpdSolveDI(&matrix_handle, nrhs, x, ldx, b, ldb);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdSolveDI: %d", ierr);
}
ierr = KmlDssSpdCleanDI(&matrix_handle);
if (ierr != 0) {
printf("\nERROR in KmlDssSpdCleanDI: %d", ierr);
}
```
