Range sugar uses R_xlen_t as start/end type #568

Merged
merged 1 commit into from Oct 24, 2016

Projects

None yet

3 participants

@thirdwing
Member

No description provided.

@eddelbuettel
Member

Looks (once again) good to me -- thanks you!

@eddelbuettel
Member

Any other votes on this? Don't make me feel so BDFL by merging without seconds ...

@kevinushey
Contributor

LGTM!

@eddelbuettel eddelbuettel merged commit 3348462 into RcppCore:master Oct 24, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@thirdwing thirdwing deleted the thirdwing:iss391_patch3 branch Oct 24, 2016
@eddelbuettel
Member

One possible issue. I just concluded another full rev. dep (and just committed log here), and the zeros/ones/eye issue is now squeaky clean.

But we have one new issue:

boot_time_inference.cpp: In function ‘Rcpp::IntegerVector cbbSequence(int, int)’:
boot_time_inference.cpp:382:52: error: ambiguous overload for ‘operator-’ (operand types are ‘Rcpp::Range’ and ‘int’)
     IntegerVector to_write = Range((j-1)*b + 1,j*b)-1;
                                                    ^
In file included from /usr/local/lib/R/site-library/Rcpp/include/Rcpp/sugar/sugar_forward.h:31:0,
                 from /usr/local/lib/R/site-library/Rcpp/include/RcppCommon.h:175,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadilloForward.h:26,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadillo.h:31,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadilloExtensions/fixprob.h:25,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:30,
                 from boot_time_inference.cpp:2:
/usr/local/lib/R/site-library/Rcpp/include/Rcpp/sugar/Range.h:77:15: note: candidate: Rcpp::Range Rcpp::Range::operator-(R_xlen_t)
         Range operator-( R_xlen_t n ){
               ^
In file included from /usr/local/lib/R/site-library/Rcpp/include/Rcpp/sugar/operators/operators.h:32:0,
                 from /usr/local/lib/R/site-library/Rcpp/include/Rcpp/sugar/sugar.h:30,
                 from /usr/local/lib/R/site-library/Rcpp/include/Rcpp.h:71,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadillo.h:34,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadilloExtensions/fixprob.h:25,
                 from /tmp/RcppDepends/lib/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:30,
                 from boot_time_inference.cpp:2:
/usr/local/lib/R/site-library/Rcpp/include/Rcpp/sugar/operators/minus.h:417:1: note: candidate: typename Rcpp::traits::enable_if<Rcpp::traits::is_convertible<typename Rcpp::traits::remove_const_and_reference<U>::type, typename Rcpp::traits::storage_type<RTYPE>::type>::value, Rcpp::sugar::Minus_Vector_Primitive<RTYPE, NA, T> >::type Rcpp::operator-(const Rcpp::VectorBase<RTYPE, NA, VECTOR>&, const U&) [with int RTYPE = 13; bool NA = false; T = Rcpp::Range; U = int; typename Rcpp::traits::enable_if<Rcpp::traits::is_convertible<typename Rcpp::traits::remove_const_and_reference<U>::type, typename Rcpp::traits::storage_type<RTYPE>::type>::value, Rcpp::sugar::Minus_Vector_Primitive<RTYPE, NA, T> >::type = Rcpp::sugar::Minus_Vector_Primitive<13, false, Rcpp::Range>]
 operator-(
 ^
/usr/lib/R/etc/Makeconf:141: recipe for target 'boot_time_inference.o' failed
make: *** [boot_time_inference.o] Error 1
ERROR: compilation failed for package ‘bootTimeInference’

@thirdwing Could you take a look? And if you do please upgrade RcppArmadillo to the GH master (as that version suppresses another noisy 'deprecated' warning from Conrad).

CCing @coatless @kevinushey

@thirdwing
Member

Will look into this.

@thirdwing
Member

My mistake. I shouldn't change int into R_xlen_t in https://github.com/RcppCore/Rcpp/blob/master/inst/include/Rcpp/sugar/Range.h#L63-L77

This now causes some ambiguousity.

@eddelbuettel
Member
eddelbuettel commented Oct 25, 2016 edited

You're fast as always, and not to worry -- that is why we run these integration tests.

I guess we could have two sets--for R_xlen_t and for int ?

@thirdwing
Member

I will fix this and add some more testing. The failing code can be good unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment