26 #define EPSILON 0.00000000000000001
46 void G_math_d_Ax(
double **A,
double *
x,
double *y,
int rows,
int cols)
52 #pragma omp for schedule(static) private(i, j, tmp)
53 for (i = 0; i < rows; i++) {
55 for (j = cols - 1; j >= 0; j--) {
56 tmp += A[i][j] *
x[j];
81 void G_math_f_Ax(
float **A,
float *
x,
float *y,
int rows,
int cols)
87 #pragma omp for schedule(static) private(i, j, tmp)
88 for (i = 0; i < rows; i++) {
90 for (j = cols - 1; j >= 0; j--) {
91 tmp += A[i][j] *
x[j];
120 #pragma omp for schedule(static) private(i, j)
121 for (i = 0; i < rows; i++) {
122 for (j = cols - 1; j >= 0; j--) {
123 A[i][j] =
x[i] * y[j];
151 #pragma omp for schedule(static) private(i, j)
152 for (i = 0; i < rows; i++) {
153 for (j = cols - 1; j >= 0; j--) {
154 A[i][j] =
x[i] * y[j];
183 double *z,
int rows,
int cols)
191 #pragma omp for schedule(static) private(i, j, tmp)
192 for (i = 0; i < rows; i++) {
194 for (j = cols - 1; j >= 0; j--) {
195 tmp += A[i][j] *
x[j] + y[j];
200 else if (
b == -1.0) {
201 #pragma omp for schedule(static) private(i, j, tmp)
202 for (i = 0; i < rows; i++) {
204 for (j = cols - 1; j >= 0; j--) {
205 tmp += a * A[i][j] *
x[j] - y[j];
211 #pragma omp for schedule(static) private(i, j, tmp)
212 for (i = 0; i < rows; i++) {
214 for (j = cols - 1; j >= 0; j--) {
215 tmp += A[i][j] *
x[j];
220 else if (a == -1.0) {
221 #pragma omp for schedule(static) private(i, j, tmp)
222 for (i = 0; i < rows; i++) {
224 for (j = cols - 1; j >= 0; j--) {
225 tmp +=
b * y[j] - A[i][j] *
x[j];
231 #pragma omp for schedule(static) private(i, j, tmp)
232 for (i = 0; i < rows; i++) {
234 for (j = cols - 1; j >= 0; j--) {
235 tmp += a * A[i][j] *
x[j] +
b * y[j];
274 #pragma omp for schedule(static) private(i, j, tmp)
275 for (i = 0; i < rows; i++) {
277 for (j = cols - 1; j >= 0; j--) {
278 tmp += A[i][j] *
x[j] + y[j];
283 else if (
b == -1.0) {
284 #pragma omp for schedule(static) private(i, j, tmp)
285 for (i = 0; i < rows; i++) {
287 for (j = cols - 1; j >= 0; j--) {
288 tmp += a * A[i][j] *
x[j] - y[j];
294 #pragma omp for schedule(static) private(i, j, tmp)
295 for (i = 0; i < rows; i++) {
297 for (j = cols - 1; j >= 0; j--) {
298 tmp += A[i][j] *
x[j];
303 else if (a == -1.0) {
304 #pragma omp for schedule(static) private(i, j, tmp)
305 for (i = 0; i < rows; i++) {
307 for (j = cols - 1; j >= 0; j--) {
308 tmp +=
b * y[j] - A[i][j] *
x[j];
314 #pragma omp for schedule(static) private(i, j, tmp)
315 for (i = 0; i < rows; i++) {
317 for (j = cols - 1; j >= 0; j--) {
318 tmp += a * A[i][j] *
x[j] +
b * y[j];
348 #pragma omp for schedule(static) private(i, j, tmp)
349 for (i = 0; i < rows; i++)
350 for (j = 0; j < i; j++) {
382 #pragma omp for schedule(static) private(i, j, tmp)
383 for (i = 0; i < rows; i++)
384 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.