---
title: KmlIssGcrAxpyX
description: "计算GCR算法中的。"
url: https://www.hikunpeng.com/document/detail/zh/hpchistory/hpckit/develop2400/kunpengaccel_kml_0792.html
sourcePath: /source/zh/hpchistory/hpckit/develop2400/kunpengaccel_kml_0792.html
indexId: 8b03271cbc0d49fff09a70129a4434911f54337e9d55bb85846054555933c7c567
---
# KmlIssGcrAxpyX

计算GCR算法中的。

#### 接口定义

C Interface：

int KmlIssGcrAxpyX(float *x, const float *p, const double *ac, const int *xl, const int *xr, const int *yl, const int *yr, const int *zl, const int *ylT, const int *yrT, const int *zlT, const int *ybegin, const int *yend, const int *zbegin, const int *zend);


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| x | float \* | GCR算法中间变量x，按(z,x,y)方向存储。 | 输入/输出 |
| p | float \* | GCR算法中间变量p，按(z,x,y)方向存储。 | 输入 |
| ax | const double \* | GCR算法中间变量alpha。 | 输入 |
| xl | const int \* | 求解空间x方向起始位置。 | 输入 |
| xr | const int \* | 求解空间x方向结束位置。 | 输入 |
| yl | const int \* | 求解空间y方向起始位置。 | 输入 |
| yr | const int \* | 求解空间y方向结束位置。 | 输入 |
| zl | const int \* | 求解空间z方向起始位置。 | 输入 |
| ylT | const int \* | 求解空间yT方向起始位置。 | 输入 |
| yrT | const int \* | 求解空间yT方向结束位置。 | 输入 |
| zlT | const int \* | 求解空间zT方向起始位置。 | 输入 |
| ybegin | const int \* | 辅助求解空间y方向起始位置。 | 输入 |
| yend | const int \* | 辅助求解空间y方向结束位置。 | 输入 |
| zbegin | const int \* | 辅助求解空间z方向起始位置。 | 输入 |
| zend | const int \* | 辅助求解空间z方向结束位置。 | 输入 |


#### 返回值

| 返回值 | 类型 | 描述 |
| --- | --- | --- |
| KMLSS\_NO\_ERROR | int | 正常执行。 |
| KMLSS\_NULL\_ARGUMENT | int | 输入中存在空指针。 |
| KMLSS\_BAD\_DATA | int | 求解空间相关参数为无效参数。 |


#### 依赖

#include "kml_gcr_specific.h"


#### 示例

C Interface：```
int xl = 5;
int yl = 5;
int zl = 5;
int xr = 6;
int yr = 6;
int zr = 6;
int ybegin = 5;
int yend = 6;
int zbegin = 5;
int zend = 6;
int ylm = 4;
int yrm = 7;
int zlm = 4;
float *x = (float*)malloc(sizeof(float) * 9);
float *p = (float*)malloc(sizeof(float) * 36);
double ac = rand();
for (int i=0; i<9; i++) {
    x[i] = rand();
}
for (int i=0; i<36; i++) {
    p[i] = rand();
}

KmlIssGcrAxpyX(x, p, &ac, &xl, &xr, &ylm, &yrm, &zlm, &yl, &yr, &zl, &ybegin, &yend, &zbegin, &zend);
```
