Thanks Hadley, much more concise :)
On Wed, Jun 24, 2015 at 2:22 PM, Hadley Wickham wrote:
> On Wed, Jun 24, 2015 at 11:08 AM, Charles Determan
> wrote:
> > Many thanks Krzysztof, your suggestion works. I can explicitly create a
> > 'new' arma::mat object and pass the resulting XPtr between fu
On Wed, Jun 24, 2015 at 11:08 AM, Charles Determan
wrote:
> Many thanks Krzysztof, your suggestion works. I can explicitly create a
> 'new' arma::mat object and pass the resulting XPtr between functions. I
> will work on making everything prettier and document for a submission to
> Rcpp Gallery
Many thanks Krzysztof, your suggestion works. I can explicitly create a
'new' arma::mat object and pass the resulting XPtr between functions. I
will work on making everything prettier and document for a submission to
Rcpp Gallery unless someone is aware of one that already exists that I
somehow o
Hi Charles, comments inline
2015-06-24 11:03 GMT-04:00 Charles Determan :
> The fastLm examples are nice but they don't contain anything relating to
> passing an XPtr between functions. Regarding your comment about making an
> XPtr around arma::mat 'innards' I'm not sure I fully understand. I t
The fastLm examples are nice but they don't contain anything relating to
passing an XPtr between functions. Regarding your comment about making an
XPtr around arma::mat 'innards' I'm not sure I fully understand. I tried
creating an XPtr around a arma::mat but no success on passing the object
betw
On 24 June 2015 at 08:22, Charles Determan wrote:
| Thank you John,
|
| I am familiar with bigmemory (I am one of the current developers actually).
| The project I am working on doesn't need the shared memory aspect so was
| intending to avoid the dependency and just leverage the more familiar a
Thank you John,
I am familiar with bigmemory (I am one of the current developers
actually). The project I am working on doesn't need the shared memory
aspect so was intending to avoid the dependency and just leverage the more
familiar and developed Armadillo library. However your response inform
Hi Charles,
> SEXP testXptr(SEXP A)
> {
> arma::Mat armaMat = Rcpp::as >(A);
> Rcpp::XPtr pMat(armaMat.memptr());
> return(pMat);
> }
armaMat is on the stack, so the Armadillo memptr is no longer valid when you
return from the testXptr function.
One simple solution in your case woul
Hi Dirk,
I was actually looking at that very page. However, I am still not sure
what I am missing here. I am not passing any pointers to functions, just
the data object. Like I said, I feel like I must be missing something
obvious but cannot figure it out. I fail to see what is distinguishing
Charles,
Maybe a close look at this will help:
http://gallery.rcpp.org/articles/passing-cpp-function-pointers/
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
___
Rcpp-devel mailing list
Rcpp-devel@lists.r-forge.r-project.org
h
I am exploring the use of some XPtr objects. For example, I can create a
pointer to an armadillo matrix. I can then create a copy of that matrix
from the pointer within the same function. However, when I try to pass a
pointer to a function and create a new copy from said pointer it fails
(return
11 matches
Mail list logo