23#define EPSILON 0.00000000000000001
43void G_math_d_Ax(
double **A,
double *x,
double *y,
int rows,
int cols)
49#pragma omp for schedule(static) private(i, j, tmp)
50 for (i = 0; i < rows; i++) {
52 for (
j = cols - 1;
j >= 0;
j--) {
53 tmp += A[i][
j] *
x[
j];
78void G_math_f_Ax(
float **A,
float *x,
float *y,
int rows,
int cols)
84#pragma omp for schedule(static) private(i, j, tmp)
85 for (i = 0; i < rows; i++) {
87 for (
j = cols - 1;
j >= 0;
j--) {
88 tmp += A[i][
j] *
x[
j];
117#pragma omp for schedule(static) private(i, j)
118 for (i = 0; i < rows; i++) {
119 for (
j = cols - 1;
j >= 0;
j--) {
120 A[i][
j] =
x[i] * y[
j];
148#pragma omp for schedule(static) private(i, j)
149 for (i = 0; i < rows; i++) {
150 for (
j = cols - 1;
j >= 0;
j--) {
151 A[i][
j] =
x[i] * y[
j];
180 double *z,
int rows,
int cols)
188#pragma omp for schedule(static) private(i, j, tmp)
189 for (i = 0; i < rows; i++) {
191 for (
j = cols - 1;
j >= 0;
j--) {
192 tmp += A[i][
j] *
x[
j] + y[
j];
197 else if (
b == -1.0) {
198#pragma omp for schedule(static) private(i, j, tmp)
199 for (i = 0; i < rows; i++) {
201 for (
j = cols - 1;
j >= 0;
j--) {
202 tmp += a * A[i][
j] *
x[
j] - y[
j];
208#pragma omp for schedule(static) private(i, j, tmp)
209 for (i = 0; i < rows; i++) {
211 for (
j = cols - 1;
j >= 0;
j--) {
212 tmp += A[i][
j] *
x[
j];
217 else if (a == -1.0) {
218#pragma omp for schedule(static) private(i, j, tmp)
219 for (i = 0; i < rows; i++) {
221 for (
j = cols - 1;
j >= 0;
j--) {
222 tmp +=
b * y[
j] - A[i][
j] *
x[
j];
228#pragma omp for schedule(static) private(i, j, tmp)
229 for (i = 0; i < rows; i++) {
231 for (
j = cols - 1;
j >= 0;
j--) {
232 tmp += a * A[i][
j] *
x[
j] +
b * y[
j];
271#pragma omp for schedule(static) private(i, j, tmp)
272 for (i = 0; i < rows; i++) {
274 for (
j = cols - 1;
j >= 0;
j--) {
275 tmp += A[i][
j] *
x[
j] + y[
j];
280 else if (
b == -1.0) {
281#pragma omp for schedule(static) private(i, j, tmp)
282 for (i = 0; i < rows; i++) {
284 for (
j = cols - 1;
j >= 0;
j--) {
285 tmp += a * A[i][
j] *
x[
j] - y[
j];
291#pragma omp for schedule(static) private(i, j, tmp)
292 for (i = 0; i < rows; i++) {
294 for (
j = cols - 1;
j >= 0;
j--) {
295 tmp += A[i][
j] *
x[
j];
300 else if (a == -1.0) {
301#pragma omp for schedule(static) private(i, j, tmp)
302 for (i = 0; i < rows; i++) {
304 for (
j = cols - 1;
j >= 0;
j--) {
305 tmp +=
b * y[
j] - A[i][
j] *
x[
j];
311#pragma omp for schedule(static) private(i, j, tmp)
312 for (i = 0; i < rows; i++) {
314 for (
j = cols - 1;
j >= 0;
j--) {
315 tmp += a * A[i][
j] *
x[
j] +
b * y[
j];
344#pragma omp for schedule(static) private(i, j, tmp)
345 for (i = 0; i < rows; i++)
346 for (
j = 0;
j < i;
j++) {
377#pragma omp for schedule(static) private(i, j, tmp)
378 for (i = 0; i < rows; i++)
379 for (
j = 0;
j < i;
j++) {
int G_math_d_A_T(double **A, int rows)
Compute the transposition of matrix A. Matrix A will be overwritten.
void G_math_d_aAx_by(double **A, double *x, double *y, double a, double b, double *z, int rows, int cols)
Compute the scaled matrix - vector product of matrix double **A and vector x and y.
void G_math_d_Ax(double **A, double *x, double *y, int rows, int cols)
Compute the matrix - vector product of matrix A and vector x.
void G_math_f_aAx_by(float **A, float *x, float *y, float a, float b, float *z, int rows, int cols)
Compute the scaled matrix - vector product of matrix A and vectors x and y.
void G_math_f_x_dyad_y(float *x, float *y, float **A, int rows, int cols)
Compute the dyadic product of two vectors. The result is stored in the matrix A.
void G_math_f_Ax(float **A, float *x, float *y, int rows, int cols)
Compute the matrix - vector product of matrix A and vector x.
void G_math_d_x_dyad_y(double *x, double *y, double **A, int rows, int cols)
Compute the dyadic product of two vectors. The result is stored in the matrix A.
int G_math_f_A_T(float **A, int rows)
Compute the transposition of matrix A. Matrix A will be overwritten.