Created
January 7, 2021 16:01
-
-
Save BerriJ/55d48c59eb919047b8ccb28ba69e4d58 to your computer and use it in GitHub Desktop.
Example Rcpp armadillo comparison double to vec
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
// [[Rcpp::depends(RcppArmadillo)]] | |
#include <RcppArmadillo.h> | |
using namespace arma; | |
// [[Rcpp::export]] | |
vec testfun(const vec &x, | |
const double &y, | |
const double &z) | |
{ | |
vec out = ((y < x) - z) % (x - y); | |
return out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment