From eee761b64f76bdf5ae73633393f4782579070039 Mon Sep 17 00:00:00 2001 From: Christopher Peters Date: Mon, 24 Aug 2020 19:32:36 +0000 Subject: [PATCH 1/2] Apparently Rcpp now prepends underscores to function names. --- R/RcppExports.R | 4 ++-- src/RcppExports.cpp | 4 ++-- src/init.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/RcppExports.R b/R/RcppExports.R index f947de4..6cfb70a 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -2,10 +2,10 @@ # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 standardize_bm <- function(xP, row_idx_) { - .Call('biglasso_standardize_bm', PACKAGE = 'biglasso', xP, row_idx_) + .Call(`_biglasso_standardize_bm`, xP, row_idx_) } get_eta <- function(xP, row_idx_, beta, idx_p, idx_l) { - .Call('biglasso_get_eta', PACKAGE = 'biglasso', xP, row_idx_, beta, idx_p, idx_l) + .Call(`_biglasso_get_eta`, xP, row_idx_, beta, idx_p, idx_l) } diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 791a512..45c6432 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -8,7 +8,7 @@ using namespace Rcpp; // standardize_bm RcppExport SEXP standardize_bm(SEXP xP, SEXP row_idx_); -RcppExport SEXP biglasso_standardize_bm(SEXP xPSEXP, SEXP row_idx_SEXP) { +RcppExport SEXP _biglasso_standardize_bm(SEXP xPSEXP, SEXP row_idx_SEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; @@ -20,7 +20,7 @@ END_RCPP } // get_eta RcppExport SEXP get_eta(SEXP xP, SEXP row_idx_, SEXP beta, SEXP idx_p, SEXP idx_l); -RcppExport SEXP biglasso_get_eta(SEXP xPSEXP, SEXP row_idx_SEXP, SEXP betaSEXP, SEXP idx_pSEXP, SEXP idx_lSEXP) { +RcppExport SEXP _biglasso_get_eta(SEXP xPSEXP, SEXP row_idx_SEXP, SEXP betaSEXP, SEXP idx_pSEXP, SEXP idx_lSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; diff --git a/src/init.c b/src/init.c index 8491f8b..a1b9463 100644 --- a/src/init.c +++ b/src/init.c @@ -141,7 +141,7 @@ extern SEXP cdfit_gaussian_hsr_bedpp_nac(SEXP X_, SEXP y_, SEXP row_idx_, SEXP safe_thresh_, SEXP verbose_); -extern SEXP biglasso_get_eta(SEXP xPSEXP, SEXP row_idx_SEXP, SEXP betaSEXP, SEXP idx_pSEXP, SEXP idx_lSEXP); +extern SEXP _biglasso_get_eta(SEXP xPSEXP, SEXP row_idx_SEXP, SEXP betaSEXP, SEXP idx_pSEXP, SEXP idx_lSEXP); static R_CallMethodDef callMethods[] = { {"cdfit_binomial_hsr", (DL_FUNC) &cdfit_binomial_hsr, 16}, @@ -162,7 +162,7 @@ static R_CallMethodDef callMethods[] = { {"cdfit_gaussian_edpp", (DL_FUNC) &cdfit_gaussian_edpp, 14}, {"cdfit_gaussian_hsr_dome_nac", (DL_FUNC) &cdfit_gaussian_hsr_dome_nac, 16}, {"cdfit_gaussian_hsr_bedpp_nac", (DL_FUNC) &cdfit_gaussian_hsr_bedpp_nac, 16}, - {"biglasso_get_eta", (DL_FUNC) &biglasso_get_eta, 5}, + {"_biglasso_get_eta", (DL_FUNC) &_biglasso_get_eta, 5}, {NULL, NULL, 0} }; From ec61f78f80c57bb70c2af406bd20ee3aadfbd660 Mon Sep 17 00:00:00 2001 From: Christopher Peters Date: Wed, 26 Aug 2020 13:17:10 +0000 Subject: [PATCH 2/2] Pass weights through to cross validation function. --- R/cv.biglasso.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/cv.biglasso.R b/R/cv.biglasso.R index 1a81d8e..d8d5c36 100644 --- a/R/cv.biglasso.R +++ b/R/cv.biglasso.R @@ -181,6 +181,7 @@ cvf <- function(i, XX, y, eval.metric, cv.ind, cv.args, parallel= FALSE) { cv.args$X <- XX cv.args$y <- y cv.args$row.idx <- which(cv.ind != i) + cv.args$weights <- cv.args$weights[cv.args$row.idx] cv.args$warn <- FALSE cv.args$ncores <- 1