File tree Expand file tree Collapse file tree 3 files changed +32
-15
lines changed
Expand file tree Collapse file tree 3 files changed +32
-15
lines changed Original file line number Diff line number Diff line change 1- coverage :
2- precision : 1
3-
41comment : false
2+ coverage :
3+ status :
4+ project :
5+ default :
6+ target : 70% # the (on purpose low) required coverage value
7+ threshold : 2% # the permitted delta in hitting the target
8+ patch :
9+ default :
10+ target : 0% # the (on purpose low) required coverage value
511
6- ignore :
7- - " inst/include/Eigen/ "
8- - " inst/include/unsupported/Eigen/ "
9-
10- codecov :
11- token : 0b726434-b483-4a82-9cfe-e8312f3b3e9b
12+ # layout: "header, diff, tree, changes"
13+ # behavior: default
14+ # require_changes: false # if true: only post the comment if coverage changes
15+ # branches: null
16+ # flags: null
17+ # paths: null
Original file line number Diff line number Diff line change 1+ 2022-01-16 Dirk Eddelbuettel <edd@debian.org>
2+
3+ * .codecov.yml: Added to not trigger PR fail for small additions
4+
5+ 2022-01-16 Mikael Jagan <jaganmn@mcmaster.ca>
6+
7+ * inst/include/RcppEigenWrap.h: Refine use plain dense wrap() change
8+
192022-01-15 Mikael Jagan <jaganmn@mcmaster.ca>
210
311 * inst/include/RcppEigenWrap.h: Use R_xlen_t for vectors rows + cols
Original file line number Diff line number Diff line change @@ -81,18 +81,21 @@ namespace Rcpp{
8181 // for plain dense objects
8282 template <typename T>
8383 SEXP eigen_wrap_plain_dense ( const T& obj, Rcpp::traits::true_type ) {
84+ bool needs_dim = T::ColsAtCompileTime != 1 ;
85+ R_xlen_t m = obj.rows (), n = obj.cols ();
86+ if (needs_dim && (m > INT_MAX || n > INT_MAX)) {
87+ Rcpp::stop (" array dimensions cannot exceed INT_MAX" );
88+ }
89+ R_xlen_t size = m * n;
8490 typename Eigen::internal::conditional<
8591 T::IsRowMajor,
8692 Eigen::Matrix<typename T::Scalar,
8793 T::RowsAtCompileTime,
8894 T::ColsAtCompileTime>,
8995 const T&>::type objCopy (obj);
90- R_xlen_t m = obj.rows (), n = obj.cols (), size = m * n;
91- if (m > INT_MAX || n > INT_MAX) {
92- Rcpp::stop (" array dimensions cannot exceed INT_MAX" );
93- }
94- SEXP ans = PROTECT (::Rcpp::wrap (objCopy.data (), objCopy.data () + size));
95- if ( T::ColsAtCompileTime != 1 ) {
96+ SEXP ans = PROTECT (::Rcpp::wrap (objCopy.data (),
97+ objCopy.data () + size));
98+ if (needs_dim) {
9699 SEXP dd = PROTECT (::Rf_allocVector (INTSXP, 2 ));
97100 int *d = INTEGER (dd);
98101 d[0 ] = m;
You can’t perform that action at this time.
0 commit comments