KmlIssGcrAxpyAp
Calculate
in the GCR algorithm.
Interface Definition
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);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
ar |
float * |
Intermediate variable ar of the GCR algorithm. It is stored in the (z, x, y) direction. |
Input/Output |
ap |
float * |
Intermediate variable ap of the GCR algorithm. It is stored in the (z, x, y) direction. |
Input/Output |
b |
const double * |
Intermediate variable beta of the GCR algorithm |
Input |
m |
const int * |
Intermediate variable j of the GCR algorithm |
Input |
mt |
const int * |
Storage location of the intermediate variable ap of the GCR algorithm. Generally, the value is j+1. |
Input |
xl |
const int * |
Start position in the x direction of the solving space |
Input |
xr |
const int * |
End position in the x direction of the solving space |
Input |
yl |
const int * |
Start position in the y direction of the solving space |
Input |
yr |
const int * |
End position in the y direction of the solving space |
Input |
zl |
const int * |
Start position in the z direction of the solving space |
Input |
zr |
const int * |
End position in the z direction of the solving space |
Input |
ybegin |
const int * |
Start position in the y direction of the auxiliary solving space |
Input |
yend |
const int * |
End position in the y direction of the auxiliary solving space |
Input |
zbegin |
const int * |
Start position in the z direction of the auxiliary solving space |
Input |
zend |
const int * |
End position in the z direction of the auxiliary solving space |
Input |
Return Value
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_NULL_ARGUMENT |
int |
A null pointer exists in the input. |
KMLSS_BAD_DATA |
int |
The parameters related to the solving space are invalid. |
Dependencies
#include "kml_gcr_specific.h"
Examples
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, ¥d, &zbegin, &zend);