Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R_xlen_t as the vector length to support long vector #303

Merged
merged 34 commits into from Jun 7, 2015

Conversation

thirdwing
Copy link
Member

Most of changes are about R_xlen_t and Rf_xlength.

Please take a careful review on Vector.h and is_arithmetic added.

The type trait is used because many packages depend the implicit conversion in Vector constructor.


template<>
struct is_arithmetic<const unsigned long> : public true_type { };

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following lines need to be protected by something like #if define(RCPP_HAS_LONG_LONG_TYPES). We may even use rcpp_long_long_type etc -- see the sibbling file traits/longlong.h.

@eddelbuettel
Copy link
Member

Not a single failure is due to the R_xlen_t change.

A few are due to my 'cache' of packages having been emptier than usual. Rerunning now, previous result summary committed in rcpp-logs repo.

@@ -53,7 +53,7 @@ namespace Rcpp{
} else {
if( ref.isNULL( ) ) throw index_out_of_bounds() ;

if( static_cast<R_len_t>(index) > ::Rf_length(ref.get__()) ) throw index_out_of_bounds() ;
if( static_cast<R_xlen_t>(index) > ::Rf_length(ref.get__()) ) throw index_out_of_bounds() ;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you cast to R_xlen_t but check against ::Rf_length. Is that intentional? Should we be using ::Rf_xlength? (In practice it doesn't really matter for this class as it represents dotted pairs and I highly doubt those ever get very large in size...)

@kevinushey
Copy link
Contributor

I made a quick review and all looks well to me barring some very minor comments. Thanks for your hard work -- this has been sorely needed for quite some time!

I'll give a 👍 to merging this after @eddelbuettel's tests run through; we might want to do a second pass and scrutinize the use of int anywhere in the code base that's used for indexing (since we likely either want R_len_t or R_xlen_t).

Also, we could try rebuilding the Rcpp gallery with this just as one last thing to check.

@jjallaire
Copy link
Member

I've merged this into feature/r_xtlen_t-vector-length here:

https://github.com/RcppCore/Rcpp/tree/feature/r_xlen_t-vector-length

We should make further fixes and tweaks on that branch. Hopefully this can be merged to master soon!

@jjallaire jjallaire merged commit f617e37 into RcppCore:master Jun 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants