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

logical indexing #16

Closed
romainfrancois opened this issue Nov 6, 2013 · 1 comment
Closed

logical indexing #16

romainfrancois opened this issue Nov 6, 2013 · 1 comment

Comments

@romainfrancois
Copy link
Contributor

logical indexing, ie NumericVector[ LogicalVector ].

We should flip the problem and delegate the responsability of extracting to a class. For example do something like this;

template <typename T>
Extractor<Vector,T> operator[]( const T& x) ;

So that we define the meaning in a separate class Extractor or something. This way we would just have to redefine Extractor when we want to handle a new extractor type.

@coatless
Copy link
Contributor

This issue has been resolved outside of a PR via Git Commit: d94ee6b

The implementation can be found at:
/inst/include/Rcpp/vector/Subsetter.h

Further refinement came to allow x > 1 in place subset via PR #349 and view assignment in PR #352.

Lastly, there is now an article on Rcpp Gallery covering this:

http://gallery.rcpp.org/articles/subsetting/

Please close. (Tagging #506)

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

No branches or pull requests

3 participants