Refactor C++ and R interface for L2 regression functions (switch to double precision, native Rcpp exports) #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors several components of the
ssemQrpackage to improve numerical precision, modernize the Rcpp interface, and enhance code maintainability and compilability.The main updates replace single-precision (
float) Eigen matrices with double-precision (double) equivalents, remove outdated.Call()wrappers, and rely on// [[Rcpp::export]]for cleaner R-C++ integration.Details
1. R/solver.R
.Call("L2Regression", ...)interface with a direct call to the exportedL2Regression()function.2. R/utils.R
.Call("ObjL2Regression", ...)and.Call("L2lamax", ...)by direct Rcpp exports.L2routines are now called via the modern Rcpp mechanism.3. src/ssemQr.cpp
MatrixXf(float) toMatrixXd(double) for better numerical precision.//[[Rcpp::export]]toL2Regression,ObjL2Regression, andL2lamax.std::vector<ArrayXi>instead ofstd::vector<ArrayXd>for integer indexing.src/LR.h
MatrixXf/VectorXftypes with template-consistent MatType.L2lrandL2lamax.MatType::Identity).src/MatOp.h
ix[i]instead ofix(i), improving compatibility withstd::vectorandArrayXi.size_t) for safety.doubleandstd::bindwithstd::minus<float>instead of deprecatedbind2nd.Testing