Removed unnecessary castings
This commit is contained in:
parent
be875cb5af
commit
7f60341812
|
@ -67,7 +67,7 @@ float *compute_jacobi(int rank, int numprocs, int n, float init_value, float thr
|
|||
for (i = 1; i <= rows; i++) {
|
||||
for (j = 1; j <= n; j++) {
|
||||
new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]);
|
||||
max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
max_diff = fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
new_x[IDX(nb, i, j)] = new_value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ float *compute_jacobi(int rank, int numprocs, int n, float init_value, float thr
|
|||
for (i = 1; i <= rows; i++) {
|
||||
for (j = 1; j <= n; j++) {
|
||||
new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]);
|
||||
max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
max_diff = fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
new_x[IDX(nb, i, j)] = new_value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ float *compute_jacobi(int n, float init_value, float threshold, borders b, int *
|
|||
for (i = 1; i <= n; i++) {
|
||||
for (j = 1; j <= n; j++) {
|
||||
new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]);
|
||||
max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
max_diff = fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
new_x[IDX(nb, i, j)] = new_value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ float *compute_jacobi(int n, float init_value, float threshold, borders b, int *
|
|||
for (i = 1; i <= n; i++) {
|
||||
for (j = 1; j <= n; j++) {
|
||||
new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]);
|
||||
max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
max_diff = fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
new_x[IDX(nb, i, j)] = new_value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,12 +59,12 @@ float *compute_jacobi(int n, float init_value, float threshold, borders b, int *
|
|||
diff_vec = _mm_sub_ps(diff_vec, tmp_vec);
|
||||
_mm_storeu_ps(diffs, diff_vec);
|
||||
for (k = 0; k < 4; k++) {
|
||||
max_diff = (float) fmaxf(max_diff, fabs(diffs[k]));
|
||||
max_diff = fmaxf(max_diff, fabs(diffs[k]));
|
||||
}
|
||||
}
|
||||
for (j = n_mult; j <= n; j++) {
|
||||
new_value = 0.25 * (x[IDX(nb, i - 1, j)] + x[IDX(nb, i, j + 1)] + x[IDX(nb, i + 1, j)] + x[IDX(nb, i, j - 1)]);
|
||||
max_diff = (float) fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
max_diff = fmaxf(max_diff, fabs(new_value - x[IDX(nb, i, j)]));
|
||||
new_x[IDX(nb, i, j)] = new_value;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user