From 8d52663e8e893a38a0982fe4c8daf402427b4e41 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Mon, 24 Jun 2024 14:05:56 +0200 Subject: [PATCH] Fixed `MADMMplasso(parallel, !pal, !legacy)` (#17) --- src/hh_nlambda_loop_cpp.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hh_nlambda_loop_cpp.cpp b/src/hh_nlambda_loop_cpp.cpp index 4bd2281..01f68c2 100644 --- a/src/hh_nlambda_loop_cpp.cpp +++ b/src/hh_nlambda_loop_cpp.cpp @@ -53,12 +53,13 @@ Rcpp::List hh_nlambda_loop_cpp( if (parallel) { // TODO: recheck all conditions (all parallel-pal combinations) // my_values is already a list of length hh - beta0 = my_values[hh]["beta0"]; - theta0 = my_values[hh]["theta0"]; - beta = my_values[hh]["beta"]; - theta = my_values[hh]["theta"]; - beta_hat = my_values[hh]["beta_hat"]; - y_hat = my_values[hh]["y_hat"]; + arma::field my_values_hh = my_values[hh]; + beta0 = my_values_hh(0).slice(0); + theta0 = my_values_hh(1).slice(0); + beta = my_values_hh(2).slice(0); + theta = my_values_hh(3); + beta_hat = my_values_hh(5).slice(0); + y_hat = my_values_hh(6).slice(0); } else if (pal) { // In this case, my_values is an empty list to be created now arma::field my_values_hh = admm_MADMMplasso_cpp(