-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f231f82
commit d3bd860
Showing
15 changed files
with
155 additions
and
5 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,20 @@ | ||
# Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
#' Return sign | ||
#' | ||
#' @param x A numeric vector | ||
#' @export | ||
xpl_nsignC <- function(x) { | ||
.Call('_xplorerr_xpl_nsignC', PACKAGE = 'xplorerr', x) | ||
} | ||
|
||
#' Repeat data | ||
#' | ||
#' @param ln A list | ||
#' @param ly A list | ||
#' @export | ||
xpl_gvar <- function(ln, ly) { | ||
.Call('_xplorerr_xpl_gvar', PACKAGE = 'xplorerr', ln, ly) | ||
} | ||
|
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.o | ||
*.so | ||
*.dll |
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,41 @@ | ||
// Generated by using Rcpp::compileAttributes() -> do not edit by hand | ||
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 | ||
|
||
#include <Rcpp.h> | ||
|
||
using namespace Rcpp; | ||
|
||
// xpl_nsignC | ||
double xpl_nsignC(NumericVector x); | ||
RcppExport SEXP _xplorerr_xpl_nsignC(SEXP xSEXP) { | ||
BEGIN_RCPP | ||
Rcpp::RObject rcpp_result_gen; | ||
Rcpp::RNGScope rcpp_rngScope_gen; | ||
Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP); | ||
rcpp_result_gen = Rcpp::wrap(xpl_nsignC(x)); | ||
return rcpp_result_gen; | ||
END_RCPP | ||
} | ||
// xpl_gvar | ||
List xpl_gvar(NumericVector ln, NumericVector ly); | ||
RcppExport SEXP _xplorerr_xpl_gvar(SEXP lnSEXP, SEXP lySEXP) { | ||
BEGIN_RCPP | ||
Rcpp::RObject rcpp_result_gen; | ||
Rcpp::RNGScope rcpp_rngScope_gen; | ||
Rcpp::traits::input_parameter< NumericVector >::type ln(lnSEXP); | ||
Rcpp::traits::input_parameter< NumericVector >::type ly(lySEXP); | ||
rcpp_result_gen = Rcpp::wrap(xpl_gvar(ln, ly)); | ||
return rcpp_result_gen; | ||
END_RCPP | ||
} | ||
|
||
static const R_CallMethodDef CallEntries[] = { | ||
{"_xplorerr_xpl_nsignC", (DL_FUNC) &_xplorerr_xpl_nsignC, 1}, | ||
{"_xplorerr_xpl_gvar", (DL_FUNC) &_xplorerr_xpl_gvar, 2}, | ||
{NULL, NULL, 0} | ||
}; | ||
|
||
RcppExport void R_init_xplorerr(DllInfo *dll) { | ||
R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); | ||
R_useDynamicSymbols(dll, FALSE); | ||
} |
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,26 @@ | ||
#include <Rcpp.h> | ||
using namespace Rcpp; | ||
|
||
//' Return sign | ||
//' | ||
//' @param x A numeric vector | ||
//' @export | ||
// [[Rcpp::export]] | ||
double xpl_nsignC(NumericVector x) { | ||
|
||
int n = x.size(); | ||
int count = 1; | ||
|
||
for(int i = 1; i < n; i++) { | ||
int l = i - 1; | ||
if(x[i] != x[l]) { | ||
count++; | ||
} | ||
} | ||
|
||
return count; | ||
} | ||
|
||
|
||
|
||
|
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,22 @@ | ||
#include <Rcpp.h> | ||
using namespace Rcpp; | ||
|
||
//' Repeat data | ||
//' | ||
//' @param ln A list | ||
//' @param ly A list | ||
//' @export | ||
// [[Rcpp::export]] | ||
List xpl_gvar(NumericVector ln, NumericVector ly) { | ||
|
||
int n = ly.size(); | ||
List out(n); | ||
|
||
for(int i = 0; i < n; i++) { | ||
out[i] = rep(i, ln[i]); | ||
} | ||
|
||
return out; | ||
|
||
} | ||
|