Skip to content

Commit

Permalink
avoid error in 'CalcPredVecchiaLatentObservedFirstOrder' function on …
Browse files Browse the repository at this point in the history
…some compilers
  • Loading branch information
fabsig committed Dec 20, 2024
1 parent 8dda44c commit e952976
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/GPBoost/Vecchia_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1305,8 +1305,17 @@ namespace GPBoost {
pred_var = vec_t(num_data_pred_cli);
#pragma omp parallel for schedule(static)
for (int i = 0; i < num_data_pred_cli; ++i) {
pred_var[i] = (Z_p_B_inv_D.row(i)).dot(Z_p_B_inv.row(i)) - (M_aux.row(i)).dot(ZpSigmaZoT.row(i));
vec_t v1 = Z_p_B_inv_D.row(i);
vec_t v2 = Z_p_B_inv.row(i);
vec_t v3 = M_aux.row(i);
vec_t v4 = ZpSigmaZoT.row(i);
pred_var[i] = v1.dot(v2) - (v3.dot(v4));
}
// the following code does not run correctly on some compilers
//#pragma omp parallel for schedule(static)
//for (int i = 0; i < num_data_pred_cli; ++i) {
// pred_var[i] = (Z_p_B_inv_D.row(i)).dot(Z_p_B_inv.row(i)) - (M_aux.row(i)).dot(ZpSigmaZoT.row(i));
//}
if (predict_response) {
pred_var.array() += 1.;
}
Expand Down

0 comments on commit e952976

Please sign in to comment.