On 2 May 2013 at 17:24, Dirk Eddelbuettel wrote:
| Sorry. It was just a quick guess.
|
| On second thought, I think your earlier approach was actually pretty good:
| Take your arma object, use wrap to turn it into a SEXP (or maybe an RObject)
| and you should then be able to set attributes.
And on third thought, I think we both overlooked one aspect:
-- R and Rcpp can share objects, passing them back and forth efficiently via
pointers as _both use the same allocation scheme_. So when Rcpp creates
an object, it is "as if" R created it. Which is why we can generally
move them back and forth.
-- That does not hold for Armadillo. So to bring an Armadillo object back,
we are better off making a copy.
So once again the "No Free Lunch" theorem at work. Sorry.
Dirk
--
Dirk Eddelbuettel | [email protected] | http://dirk.eddelbuettel.com
_______________________________________________
Rcpp-devel mailing list
[email protected]
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel