---
title: KmlIssGcrAxpyAp
description: "计算GCR算法中的。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_0845.html
sourcePath: /source/zh/kunpenghpcs/hpckit/devg/kunpengaccel_kml_0845.html
indexId: e979b4f79590ef8de3107c041313d3b3c103d91838cc7168880a03f86e4d6d9561
---
# KmlIssGcrAxpyAp

计算GCR算法中的。

#### 接口定义

C Interface：

int KmlIssGcrAxpyAp(float *ar, float *ap, const double *b, const int *m, const int *mt, const int *xl, const int *xr, const int *yl, const int *yr, const int *zl, const int *zr, const int *ybegin, const int *yend, const int *zbegin, const int *zend);


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| ar | float \* | GCR算法中间变量ar，按(z,x,y)方向存储。 | 输入/输出 |
| ap | float \* | GCR算法中间变量ap，按(z,x,y)方向存储。 | 输入/输出 |
| b | const double \* | GCR算法中间变量beta。 | 输入 |
| m | const int \* | GCR算法中间变量j。 | 输入 |
| mt | const int \* | GCR算法中间变量ap存储位置，一般为j+1。 | 输入 |
| xl | const int \* | 求解空间x方向起始位置。 | 输入 |
| xr | const int \* | 求解空间x方向结束位置。 | 输入 |
| yl | const int \* | 求解空间y方向起始位置。 | 输入 |
| yr | const int \* | 求解空间y方向结束位置。 | 输入 |
| zl | const int \* | 求解空间z方向起始位置。 | 输入 |
| zr | const int \* | 求解空间z方向结束位置。 | 输入 |
| 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 = yl;
int yend = yr;
int zbegin = zl;
int zend = zr;
int m = 1;
int mt = 2;
float *ar = (float*)malloc(sizeof(float) * 9);
float *ap = (float*)malloc(sizeof(float) * 36);
double *b = (double*)malloc(sizeof(double) * 2);
for (int i=0; i<9; i++) {
    ar[i] = rand();
}
for (int i=0; i<36; i++) {
    ap[i] = rand();
}
for (int i=0; i<2; i++) {
    b[i] = 1.0;
}

KmlIssGcrAxpyAp(ar, ap, b, &m, &mt, &xl, &xr, &yl, &yr, &zl, &zr, &ybegin, &yend, &zbegin, &zend);
```
