// [[Rcpp::plugins(cpp11)]] #include // [[Rcpp::depends(dqrng)]] #include "convert_seed.h" #include #include template std::string convert_base(Rcpp::IntegerVector seed) { U out=dqrng::convert_seed(seed); std::stringstream ss; ss << out; return ss.str(); } // [[Rcpp::export]] std::string convert_16(Rcpp::IntegerVector seed) { return convert_base(seed); } // [[Rcpp::export]] std::string convert_32(Rcpp::IntegerVector seed) { return convert_base(seed); } // [[Rcpp::export]] std::string convert_64(Rcpp::IntegerVector seed) { return convert_base(seed); } // [[Rcpp::export]] bool is_signed_consistent(Rcpp::IntegerVector seed) { uint64_t val=dqrng::convert_seed(seed); std::vector casted(seed.begin(), seed.end()); uint64_t comp=dqrng::convert_seed(casted.data(), casted.size()); return (val==comp); }