greannmhar

computeVectorB

Nov 5th, 2025
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. void computeVectorB(int n, double *A, double *b) {
  2. for (int i = 0; i < n; ++i) {
  3. b[i] = 0.0;
  4. for (int k = 0; k <= (n + 1) / 2; k++) {
  5. int j = 2 * k;
  6. if (j < n) {
  7. b[i] += A[i * n + j];
  8. }
  9. }
  10. }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment