From ccf4e7f6384c29f258091e3201b9658aa0641cca Mon Sep 17 00:00:00 2001 From: Paul Staab Date: Mon, 30 Oct 2017 16:36:28 +0100 Subject: [PATCH] Register native routines (#32) --- DESCRIPTION | 2 +- NEWS | 7 +++++++ R/RcppExports.R | 8 ++++---- src/RcppExports.cpp | 21 +++++++++++++++++---- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index c6748aa..f5b8e1d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: scrm Type: Package Title: Simulating the Evolution of Biological Sequences -Version: 1.7.2-0 +Version: 1.7.2-1 Authors@R: c( person('Paul', 'Staab', , 'develop@paulstaab.de', role=c('aut', 'cre', 'cph')), person('Zhu', 'Sha', role=c('aut', 'cph')), diff --git a/NEWS b/NEWS index aaaefe3..a7ac8e4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,10 @@ +scrm 1.7.2-1 +============ + +* Registered native routines. + + + scrm 1.7.2-0 ============ diff --git a/R/RcppExports.R b/R/RcppExports.R index 16f0280..f501093 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -44,18 +44,18 @@ #' scrm('10 3 -r 400 1000000 -l 100000 -I 2 4 6 0.5 -t 300 -oSFS')$sfs #' scrm <- function(args, file = "") { - .Call('scrm_scrm', PACKAGE = 'scrm', args, file) + .Call('_scrm_scrm', PACKAGE = 'scrm', args, file) } test_RRG_sample <- function() { - .Call('scrm_test_RRG_sample', PACKAGE = 'scrm') + .Call('_scrm_test_RRG_sample', PACKAGE = 'scrm') } test_RRG_sampleUnitExpo <- function() { - .Call('scrm_test_RRG_sampleUnitExpo', PACKAGE = 'scrm') + .Call('_scrm_test_RRG_sampleUnitExpo', PACKAGE = 'scrm') } test_RRG_sampleExpoExpoLimit <- function(lambda, b, limit) { - .Call('scrm_test_RRG_sampleExpoExpoLimit', PACKAGE = 'scrm', lambda, b, limit) + .Call('_scrm_test_RRG_sampleExpoExpoLimit', PACKAGE = 'scrm', lambda, b, limit) } diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index f04480e..334b04c 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -7,7 +7,7 @@ using namespace Rcpp; // scrm List scrm(std::string args, std::string file); -RcppExport SEXP scrm_scrm(SEXP argsSEXP, SEXP fileSEXP) { +RcppExport SEXP _scrm_scrm(SEXP argsSEXP, SEXP fileSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; @@ -19,7 +19,7 @@ END_RCPP } // test_RRG_sample double test_RRG_sample(); -RcppExport SEXP scrm_test_RRG_sample() { +RcppExport SEXP _scrm_test_RRG_sample() { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; @@ -29,7 +29,7 @@ END_RCPP } // test_RRG_sampleUnitExpo double test_RRG_sampleUnitExpo(); -RcppExport SEXP scrm_test_RRG_sampleUnitExpo() { +RcppExport SEXP _scrm_test_RRG_sampleUnitExpo() { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; @@ -39,7 +39,7 @@ END_RCPP } // test_RRG_sampleExpoExpoLimit double test_RRG_sampleExpoExpoLimit(double lambda, double b, double limit); -RcppExport SEXP scrm_test_RRG_sampleExpoExpoLimit(SEXP lambdaSEXP, SEXP bSEXP, SEXP limitSEXP) { +RcppExport SEXP _scrm_test_RRG_sampleExpoExpoLimit(SEXP lambdaSEXP, SEXP bSEXP, SEXP limitSEXP) { BEGIN_RCPP Rcpp::RObject rcpp_result_gen; Rcpp::RNGScope rcpp_rngScope_gen; @@ -50,3 +50,16 @@ BEGIN_RCPP return rcpp_result_gen; END_RCPP } + +static const R_CallMethodDef CallEntries[] = { + {"_scrm_scrm", (DL_FUNC) &_scrm_scrm, 2}, + {"_scrm_test_RRG_sample", (DL_FUNC) &_scrm_test_RRG_sample, 0}, + {"_scrm_test_RRG_sampleUnitExpo", (DL_FUNC) &_scrm_test_RRG_sampleUnitExpo, 0}, + {"_scrm_test_RRG_sampleExpoExpoLimit", (DL_FUNC) &_scrm_test_RRG_sampleExpoExpoLimit, 3}, + {NULL, NULL, 0} +}; + +RcppExport void R_init_scrm(DllInfo *dll) { + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); +}