On 22 May 2014 at 15:38, Chaomei Lo wrote:
| Hi, Dirk,
|  
| I have created R packages using Makevars and it works pretty good for me. I am
| able to convert from a Rcpp::NumericVector to std::vector as in below.
|  
| NumericVector col_cts = buildMatrix(Xr);
| 
| vector<long unsigned int> col_counts = Rcpp::as<vector<long unsigned int>>
| (col_cts);
|   
| Now I am having a problem with an application involves the Trilinos library.
| Here below I am trying to convert a Rcpp::NumericVector to Teuchos::ArrayRCP
| <size_t> in the following line, it gave me errors as shown below in red.  
Would
| you please help me with this ?
|  
| Teuchos::ArrayRCP<size_t> col_counts=Rcpp::as<Teuchos::ArrayRCP<size_t>>
| (col_cts);

"There is a vignette for that":  Rcpp-extending, which describes how to
create as<>() and wrap() for your chosen library.

There are examples in existing packages such as RcppArmadillo, RcppBDT and
more.  There are examples on the Rcpp Gallery.

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