Task 6 and 7 are done!

This commit is contained in:
AZEN-SGG 2025-03-26 22:44:12 +03:00
parent 2058f7ed6f
commit 87e1eb75d5
36 changed files with 883 additions and 21 deletions

View file

@ -9,14 +9,13 @@ void init_vec_b(const double * restrict a, double * restrict b, int n)
double sum = 0;
#pragma omp simd reduction(+:sum)
for (int k = 1; k < n; k+=2)
for (int k = 0; k < n; k+=2)
sum += a[i * n + k];
b[i] = sum;
}
}
void matvec_mul(int n, const double * restrict A, const double * restrict x, double * restrict x_k)
{
#pragma omp parallel for
@ -29,3 +28,4 @@ void matvec_mul(int n, const double * restrict A, const double * restrict x, dou
x_k[i] = sum;
}
}