---
title: KmlDssGenClean?I
description: "C Interface："
url: https://www.hikunpeng.com/document/detail/zh/kunpengaccel/math-lib/devg-kml/kunpengaccel_kml_0825.html
sourcePath: /source/zh/kunpengaccel/math-lib/devg-kml/kunpengaccel_kml_0825.html
indexId: d3cfadb1b14635e84bf85defb0d3ab0808e8158a2280f4213a07f7eb5494f93168
---
# KmlDssGenClean?I

#### 接口定义

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