我想同时使用RcppGSL和RcppArmadillo,是否可以在cxxfunction(内联CRAN软件包的)中使用多个插件?我找到了一种方法:
plug.ArmaGSL <- Rcpp:::Rcpp.plugin.maker(include.before='#include <RcppArmadillo.h>
#include <RcppGSL.h>
#include <gsl/gsl_rng.h>',
Depends=c("RcppGSL", "RcppArmadillo", "Rcpp"),
LinkingTo=c("RcppGSL", "RcppArmadillo", "Rcpp"),
libs="-lgsl -larmadillo")
registerPlugin("RcppArmaGSL", plug.ArmaGSL)
foo <- cxxfunction(signature(sM="numeric"), body=bodytxt, inc=inctxt, plugin="RcppArmaGSL")
Run Code Online (Sandbox Code Playgroud)
但似乎不那么直观。
| 归档时间: |
|
| 查看次数: |
635 次 |
| 最近记录: |