Steven,

In a case like this I would try to set up a fist minimal working example
using just plain C++, and no R. Once that works, try it with R.

For Armadillo, the docs at http://arma.sourceforge.net/docs.html#Mat are your
best shot.  I presume you saw what it says about strict=true. Also, in 

   double* p = static_cast<double*>( malloc( 30*sizeof(double) ));
   arma::mat M(p, 3,10, false, true ); // this works nicely

you are going against the "Writing R Extensions" rule of mixing system
malloc/free with R.  That is generally a bad idea.

If your intent is to keep memory 'fixed' and outside of R, you can use
Bigmemory objects via external pointers (Rcpp::XPtr). This may be of
interest: http://gallery.rcpp.org/articles/using-bigmemory-with-rcpp/

That should extend to wrapping Armadillo around such memory. After all,
Armadillo behaves just _great_ with the R-allocated objects we pass back and
forth.

Hope this helps,  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

Reply via email to