Skip to content

Commit

Permalink
Register native routines (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstaab committed Oct 30, 2017
1 parent 0a2bbc1 commit ccf4e7f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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')),
Expand Down
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
scrm 1.7.2-1
============

* Registered native routines.



scrm 1.7.2-0
============

Expand Down
8 changes: 4 additions & 4 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

21 changes: 17 additions & 4 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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);
}

0 comments on commit ccf4e7f

Please sign in to comment.