-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Todo: migrate Range in random.cpp - disambiguates `stop()` to `Rcpp::stop()` throughout. `cpp11::stop()` doesn't seem to throw errors that testthat sees as errors. - Updates cpp11 / Rcpp setup, removing init.c - Need to call `Rcpp::compileAttributes()` and `devtools::document()` as functions are migrated.
- Loading branch information
1 parent
5c23a55
commit 6469b35
Showing
14 changed files
with
100 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Generated by cpp11: do not edit by hand | ||
|
||
random_impl <- function(genome, length, n, seed) { | ||
.Call(`_valr_random_impl`, genome, length, n, seed) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Generated by cpp11: do not edit by hand | ||
// clang-format off | ||
|
||
#include <cpp11/R.hpp> | ||
#include <Rcpp.h> | ||
using namespace Rcpp; | ||
#include "cpp11/declarations.hpp" | ||
#include <R_ext/Visibility.h> | ||
|
||
// random.cpp | ||
writable::data_frame random_impl(DataFrame genome, int length, int n, int seed); | ||
extern "C" SEXP _valr_random_impl(SEXP genome, SEXP length, SEXP n, SEXP seed) { | ||
BEGIN_CPP11 | ||
return cpp11::as_sexp(random_impl(cpp11::as_cpp<cpp11::decay_t<DataFrame>>(genome), cpp11::as_cpp<cpp11::decay_t<int>>(length), cpp11::as_cpp<cpp11::decay_t<int>>(n), cpp11::as_cpp<cpp11::decay_t<int>>(seed))); | ||
END_CPP11 | ||
} | ||
|
||
extern "C" { | ||
/* .Call calls */ | ||
extern SEXP _valr_bed12toexons_impl(SEXP); | ||
extern SEXP _valr_closest_impl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_complement_impl(SEXP, SEXP); | ||
extern SEXP _valr_coverage_impl(SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_dist_impl(SEXP, SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_flank_impl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_gcoverage_impl(SEXP, SEXP); | ||
extern SEXP _valr_intersect_impl(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_makewindows_impl(SEXP, SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_merge_impl(SEXP, SEXP, SEXP); | ||
extern SEXP _valr_partition_impl(SEXP, SEXP); | ||
extern SEXP _valr_shuffle_impl(SEXP, SEXP, SEXP, SEXP, SEXP); | ||
extern SEXP _valr_subtract_impl(SEXP, SEXP, SEXP, SEXP); | ||
|
||
static const R_CallMethodDef CallEntries[] = { | ||
{"_valr_bed12toexons_impl", (DL_FUNC) &_valr_bed12toexons_impl, 1}, | ||
{"_valr_closest_impl", (DL_FUNC) &_valr_closest_impl, 6}, | ||
{"_valr_complement_impl", (DL_FUNC) &_valr_complement_impl, 2}, | ||
{"_valr_coverage_impl", (DL_FUNC) &_valr_coverage_impl, 4}, | ||
{"_valr_dist_impl", (DL_FUNC) &_valr_dist_impl, 5}, | ||
{"_valr_flank_impl", (DL_FUNC) &_valr_flank_impl, 8}, | ||
{"_valr_gcoverage_impl", (DL_FUNC) &_valr_gcoverage_impl, 2}, | ||
{"_valr_intersect_impl", (DL_FUNC) &_valr_intersect_impl, 7}, | ||
{"_valr_makewindows_impl", (DL_FUNC) &_valr_makewindows_impl, 5}, | ||
{"_valr_merge_impl", (DL_FUNC) &_valr_merge_impl, 3}, | ||
{"_valr_partition_impl", (DL_FUNC) &_valr_partition_impl, 2}, | ||
{"_valr_random_impl", (DL_FUNC) &_valr_random_impl, 4}, | ||
{"_valr_shuffle_impl", (DL_FUNC) &_valr_shuffle_impl, 5}, | ||
{"_valr_subtract_impl", (DL_FUNC) &_valr_subtract_impl, 4}, | ||
{NULL, NULL, 0} | ||
}; | ||
} | ||
|
||
extern "C" attribute_visible void R_init_valr(DllInfo* dll){ | ||
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); | ||
R_useDynamicSymbols(dll, FALSE); | ||
R_forceSymbols(dll, TRUE); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.