RInside を使用するコンテキストでのRcpp::InternalFunction
と の違いは何ですか? LOAD_RCPP_MODULE
それらは同じ目的を持っているようですLOAD_RCPP_MODULE
が、余分なレイヤーがあります。それらの両方のユースケースは何ですか? また、いつどちらを優先する必要がありますか?
//example with LOAD_RCPP_MODULE
const char* hello( std::string who ){
std::string result( "hello " ) ;
result += who ;
return result.c_str() ;
}
RCPP_MODULE(bling){
using namespace Rcpp ;
function( "hello", &hello );
}
R["bling"] = LOAD_RCPP_MODULE(bling);
これが他の例です
//example with Rcpp::InternalFunction
const char* hello( std::string who ){
std::string result( "hello " ) ;
result += who ;
return result.c_str() ;
}
R["hello"] = Rcpp::InternalFunction( &hello )