for (k = 0; k < j; k++) sum += LU[j*N + k] * B[k*N + i]; B[j*N + i] = (B[j*N + i] - sum); } } } void upper_solve(double *B, double* LU, int n, int N) { /* Solve B'*U=B */ /* U - given */ /* B - given */ /* solve for B' */ double *B00, *B01, *B10, *B11; if (n > min_block_size) { int nby2 = n / 2; B00 = B; B01 = B + nby2; B10 = B + nby2*N; B11 = B + nby2*N + nby2; cilk_spawn top_upper_half_solve(B00, B01, LU, nby2, N); bottom_upper_half_solve(B10, B11, LU, nby2, N); } else if (n == min_block_size) { upper_solve_serial(B, LU, n, N); }
for (k = 0; k < j; k++) sum += LU[j*N + k] * B[k*N + i]; B[j*N + i] = (B[j*N + i] - sum); } } } void upper_solve(double *B, double* LU, int n, int N) { /* Solve B'*U=B */ /* U - given */ /* B - given */ /* solve for B' */ double *B00, *B01, *B10, *B11; if (n > min_block_size) { int nby2 = n / 2; B00 = B; B01 = B + nby2; B10 = B + nby2*N; B11 = B + nby2*N + nby2; cilk_spawn top_upper_half_solve(B00, B01, LU, nby2, N); bottom_upper_half_solve(B10, B11, LU, nby2, N); } else if (n == min_block_size) { upper_solve_serial(B, LU, n, N); }