Skip to content

Commit

Permalink
Merge pull request #45 from USCbiostats/gw-cv-fix
Browse files Browse the repository at this point in the history
fix Eigen::Map for empty matrix in CV entrypoint
  • Loading branch information
gmweaver authored Jun 26, 2024
2 parents 14b6395 + a90eaba commit dedd057
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rcpp_wrappers_cv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Eigen::VectorXd fitModelCVRcpp(SEXP x,
);
else {
Rcpp::NumericMatrix ext_mat(ext);
MapMat extmap((const double *) &ext_mat[0], ext_mat.rows(), ext_mat.cols());
MapMat extmap = createEigenMapFromRcppNumericMatrix(ext);
return fitModelCV<MapMat, MapMat>(
xmap, is_sparse_x, y, extmap, fixed,
weights_user, intr, stnd, penalty_type,
Expand All @@ -211,7 +211,7 @@ Eigen::VectorXd fitModelCVRcpp(SEXP x,
}
else {
Rcpp::NumericMatrix ext_mat(ext);
MapMat extmap((const double *) &ext_mat[0], ext_mat.rows(), ext_mat.cols());
MapMat extmap = createEigenMapFromRcppNumericMatrix(ext);
return fitModelCV<MapMat, MapMat>(
xmap, is_sparse_x, y, extmap, fixed, weights_user,
intr, stnd, penalty_type, cmult,
Expand All @@ -235,7 +235,7 @@ Eigen::VectorXd fitModelCVRcpp(SEXP x,
}
else {
Rcpp::NumericMatrix ext_mat(ext);
MapMat extmap((const double *) &ext_mat[0], ext_mat.rows(), ext_mat.cols());
MapMat extmap = createEigenMapFromRcppNumericMatrix(ext);
return fitModelCV<MapSpMat, MapMat>(
Rcpp::as<MapSpMat>(x), is_sparse_x, y, extmap,
fixed, weights_user, intr, stnd, penalty_type, cmult,
Expand Down

0 comments on commit dedd057

Please sign in to comment.