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

计算GCR算法中的。

#### 接口定义

C Interface：

int KmlIssGcrDotprodBeta(const float *ar, const float *ap, double *c, const int *m, 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 | const float \* | GCR算法中间变量ar，按(z,x,y)方向存储。 | 输入 |
| ap | const float \* | GCR算法中间变量ap，按(z,x,y)方向存储。 | 输入 |
| c | double \* | 计算结果beta。 | 输入/输出 |
| m | const int \* | GCR算法中间变量j。 | 输入 |
| 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方向结束位置。 | 输入 |


#### 依赖

#include "kml_gcr_specific.h"


#### 返回值

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


#### 示例

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 m = 1;
float *r = (float*)malloc(sizeof(float) * 27);
float *ap = (float*)malloc(sizeof(float) * 108);
double *c=(double*)malloc(sizeof(double) * 4);
for (int i=0; i<27; i++) {
    r[i] = rand();
}
for (int i=0; i<108; i++) {
    ap[i] = rand();
}
for (int i=0; i<4; i++) {
    c[i] = 0.0;
}

KmlIssGcrDotprodBeta(r, ap, c, &m, &xl, &xr, &yl, &yr, &zl, &zr, &ybegin, &yend, &zbegin, &zend);
```
