Skip to content

Commit

Permalink
Fixed hh index (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Jan 26, 2024
1 parent 9d3caac commit 141f815
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 @@ -44,7 +44,7 @@ Rcpp::List hh_nlambda_loop_cpp(
arma::vec n_main_terms;
Rcpp::List lam_list;
arma::mat y_hat = y;
unsigned int hh = 1;
unsigned int hh = 0;
while (hh <= nlambda) {
arma::vec lambda = lam.row(hh);

Expand Down Expand Up @@ -104,7 +104,7 @@ Rcpp::List hh_nlambda_loop_cpp(
// Y_HAT[[hh]] <- y_hat
// THETA[[hh]] <- as.sparse3Darray(theta1)

if (hh == 1) {
if (hh == 0) {
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;
Expand Down

0 comments on commit 141f815

Please sign in to comment.