Skip to content

Commit

Permalink
Using safe element access (#17)
Browse files Browse the repository at this point in the history
`[]` is technically possible, but has no bounds check. See <https://arma.sourceforge.net/docs.html#element_access> for more details.
  • Loading branch information
wleoncio committed Jan 26, 2024
1 parent 916706e commit 998845b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hh_nlambda_loop_cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ Rcpp::List hh_nlambda_loop_cpp(
// THETA[[hh]] <- as.sparse3Darray(theta1)

if (hh == 1) {
Rcpp::Rcout << hh << n_main_terms[hh] << non_zero_theta[hh] << obj1 << std::endl;
Rcpp::Rcout << hh << n_main_terms(hh) << non_zero_theta(hh) << obj1 << std::endl;
} else {
Rcpp::Rcout << hh << n_main_terms[hh] << non_zero_theta[hh] << obj[hh - 1] << obj1 << std::endl;
Rcpp::Rcout << hh << n_main_terms(hh) << non_zero_theta(hh) << obj(hh - 1) << obj1 << std::endl;
}
hh += 1;
}
Expand Down

0 comments on commit 998845b

Please sign in to comment.