[Rcpp-devel] Rcpp version of DATAPTR
Whit Armstrong
armstrong.whit at gmail.com
Wed Apr 11 21:32:47 CEST 2012
Thanks, Dirk.
one more quick q.
Should I be doing something to prevent these warnings:
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloConfig.h:64:0:
warning: "ARMA_DEFAULT_OSTREAM" redefined [enabled by default]
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/config.hpp:73:0:
note: this is the location of the previous definition
Or is this the intended effect of remapping std::cout to Rout?
I'm just wondering if Kurt H and the rest of CRAN at R-project.org will
view those warnings as blockers for package submission?
-Whit
On Wed, Apr 11, 2012 at 2:42 PM, Dirk Eddelbuettel <edd at debian.org> wrote:
>
> On 11 April 2012 at 14:16, Whit Armstrong wrote:
> | I've been looking in the archives of this list for a while, so forgive
> | me if I've missed it.
> |
> | Does Rcpp expose a version of the DATAPTR macro?
>
> Nothing rings an immediate bell...
>
> | Sadly, I have a need for a void* in my code... So I need a very old
> | school C way of accessing the raw memory referenced by an SEXP.
> |
> | I tried to use RAW(), but the version of RAW exposed when using Rcpp
> | is from memory.c, which wraps all the calls w/ checks like this:
> | if(TYPEOF(x) != RAWSXP)
> | error("%s() can only be applied to a '%s', not a '%s'",
> | "RAW", "raw", type2char(TYPEOF(x)));
>
> Just about "everything" inherits from RObject, and RObject has the protected
> 'SEXP m_sexp;' you may get at.
>
> Otherwise, you can use wrap() to turn an Rcpp object back into a SEXP after
> which you have DATAPTR and all the other treasures of the R API.
>
> Dirk
>
> --
> R/Finance 2012 Conference on May 11 and 12, 2012 at UIC in Chicago, IL
> See agenda, registration details and more at http://www.RinFinance.com
More information about the Rcpp-devel
mailing list