Comments (10)
RcppArray
v0.3.0, with the tuple support added, is now on CRAN.
from rcpp.
Howdy and thanks for suggesting that. We will take a look. It may otherwise be easiest to do this in a small add-on package as e.g. was done in RcppArray (also supporting std::span
if C++20 is used).
from rcpp.
Very happy to look into merging this into RcppArray
, as it does seem like a natural extension and saves creating another small extension package for a similar purpose.
from rcpp.
Sounds good to me, @andrjohns is closer to the metal for a concrete use case. I am sure we can cook up a unit test or two, I always liked how you set up tester packages in RcppArray (and Rcpp has long done similar stuff for parts of its tests).
from rcpp.
Gee I just realized in horror that I think I never experimented / reached out to @jonclayden here! John, any 'feels' about extending RcppArray with this (pro: it seems to fit; con: it may clutter the package) or whether this should be something on its own (pro: self-contained is good ?; con: clutters package system?).
from rcpp.
The commit referenced above provides a version of the implementation that avoids using helpers from C++14 (index_sequence
) and C++17 (apply()
), to try and maximise compatibility. Instead it uses a nested helper struct holding references to the tuple and the R list, each "level" of which is responsible for an element of the tuple. I have tests for the as()
direction (though not yet for wrap()
) and it seems to work. I don't imagine this will be noticeably less efficient, and it compiles with CXX_STD=CXX11
, but testing/feedback is very welcome.
from rcpp.
I've added a tuple client stub package now, and unfortunately wrap()
chokes on this assertion, whether my implementation or the version above using apply()
is used. The specialisation is declared before including the full Rcpp.h
but somehow dispatch isn't working out correctly. I'll need to have another look with a clearer head...
from rcpp.
The problem seems to have been including the wrap()
implementation within the Rcpp::traits
namespace, when it should just be in Rcpp
. The Rcpp-extending vignette threw me here, I think, because it seems to indicate that partial specialisations should live in Rcpp::traits
(section 2.3), although that does seem surprising – am I misreading it? Anyway, that seems to have been the mistake relative to the version above, now corrected.
@andrjohns I'll add you as a contributor to the RcppArray
package, assuming you're happy with that. If the current implementation works for you then I'll put together a release for CRAN.
from rcpp.
Yes, that documentation / implementation could do with a rewrite. It also throws me for loops at times. So twice the thanks for working through it !!
from rcpp.
We can close this as RcppArray
took care of it. Three cheers for that!
from rcpp.
Related Issues (20)
- Avoid readability-avoid-const-params-in-decls? HOT 5
- Add support for check.names HOT 5
- Compiler warning on windows-arm64 (libc++) HOT 3
- Figure 3 incorrect caption in Rcpp-introduction vignette HOT 2
- sourceCpp crashes R when called about 1000 times on same code HOT 10
- Integer overflow in `MatrixRow` offset calculations for large matrices HOT 8
- Switch from S4SXP to OBJSXP HOT 2
- pass by const refererence HOT 1
- A fresh -Wformat-security issue under r-devel HOT 9
- 'CRAN package Rcpp' notice HOT 5
- Installation/Compiling Error for Package with Rcpp dependency - Ubuntu (rvmf.cpp?) HOT 5
- Exporting classes using `Rcpp::interfaces(cpp)` that are shared among multiple cpp files through header file HOT 13
- test_packageversion fails with Rcpp 1.0.12 HOT 3
- Question regarding replacement by reference of <RTYPE>Array class without making copy HOT 8
- Cannot make std::vector<int8_t> from NumericVector HOT 4
- issue building phangorn 2.11 for wasm HOT 3
- New warnings from -Wconversion -Wno-sign-conversion HOT 3
- compileAttributes and use of .External2() for calling native symbol routine HOT 6
- Exporting comments into function definitions HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rcpp.