Task 6 was fixed and Task 8 was done
This commit is contained in:
parent
863948011f
commit
0a8c75a0cf
45 changed files with 1294 additions and 241 deletions
|
|
@ -29,8 +29,8 @@ void t6_solve(const double * restrict A, double * restrict x_0, const double * r
|
|||
#pragma omp simd reduction(+:sum)
|
||||
for (int j = 0; j < n; ++j)
|
||||
sum += A[i*n + j] * r[j];
|
||||
|
||||
dot_ADr_r += sum * r[i];
|
||||
|
||||
dot_ADr_r += sum * r[i] * A[i*n + i];
|
||||
dot_ADr_ADr += sum * sum;
|
||||
}
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ void t6_solve(const double * restrict A, double * restrict x_0, const double * r
|
|||
|
||||
#pragma omp simd
|
||||
for (int i = 0; i < n; ++i)
|
||||
x[i] = x_0[i] - r[i]*t;
|
||||
x[i] = x_0[i] - (r[i]*t);
|
||||
|
||||
swap_temp = x;
|
||||
x = x_0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue