2013-09-26 18 views

回答

0

它當然應該。提升數學只是一個頭文件庫;因此,我們可以測試使用開瑞Rcpp Gallery post升壓tgamma功能作爲模型

線沿線的東西:

// Use brandnew CRAN package BH for Boost headers 

// [[Rcpp::depends(BH)]] 
#include <Rcpp.h> 
#include <boost/foreach.hpp> 
#include <boost/math/special_functions/gamma.hpp> 

#define foreach BOOST_FOREACH 

using namespace boost::math; 

//[[Rcpp::export]] 
Rcpp::NumericVector boost_gamma(Rcpp::NumericVector x) { 
    foreach(double& elem, x) { 
    elem = boost::math::tgamma(elem); 
    }; 

    return x; 
} 

,然後快速檢查:

> identical(boost_gamma(0:10 + 1), factorial(0:10)) 
[1] TRUE 

不是說這個測試也意味着很多,除了說頭很容易包括和可用。

查看BigMemory Description文件的DependsLinkingTo,並注意其中的BH

最後,通過查看News頁面,您可以隨時瞭解BH包的設置更新。

玩得開心!