cxxfunction 中的多个插件 [英] Multiple plugins in cxxfunction

查看:23
本文介绍了cxxfunction 中的多个插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想同时使用 RcppGSL 和 RcppArmadillo,是否可以在 cxxfunction(内联 CRAN 包)中使用多个插件?我找到了一种方法:

I want to use RcppGSL and RcppArmadillo at the same time, is that possible to use multiple plugins in cxxfunction (of the inline CRAN package) ? I found a way to do:

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")

但似乎不是那么直观.

推荐答案

好问题.(而且在 rcpp-devel 上会更好.)

Nice question. (And would have been even better on rcpp-devel.)

我认为您需要编写自己的组合插件,详情请参阅 Rcpp-FAQ 小插图的问题 3.6如何为内联包编写插件".

I think you need to write your own combined plugin, see Question 3.6 'How do I write a plugin for the inline package' of the Rcpp-FAQ vignette for details.

这篇关于cxxfunction 中的多个插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆