From d57e5b5bd2ecce45f1c4b9055b48335b24b4a265 Mon Sep 17 00:00:00 2001 From: LTLA Date: Sun, 12 May 2019 18:48:02 -0700 Subject: [PATCH] Explicitly include required std headers for xoshiro. Inline template specializations for correct linking, fixes #28. --- inst/include/dqrng_generator.h | 8 ++++---- inst/include/xoshiro.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/inst/include/dqrng_generator.h b/inst/include/dqrng_generator.h index 028c077..682805a 100644 --- a/inst/include/dqrng_generator.h +++ b/inst/include/dqrng_generator.h @@ -151,27 +151,27 @@ class random_64bit_wrapper : public random_64bit_generator { }; template<> -void random_64bit_wrapper<::dqrng::xoroshiro128plus>::seed(result_type seed, result_type stream) { +inline void random_64bit_wrapper<::dqrng::xoroshiro128plus>::seed(result_type seed, result_type stream) { gen.seed(seed); gen.jump(stream); cache = false; } template<> -void random_64bit_wrapper<::dqrng::xoshiro256plus>::seed(result_type seed, result_type stream) { +inline void random_64bit_wrapper<::dqrng::xoshiro256plus>::seed(result_type seed, result_type stream) { gen.seed(seed); gen.long_jump(stream); cache = false; } template<> -void random_64bit_wrapper::seed(result_type seed, result_type stream) { +inline void random_64bit_wrapper::seed(result_type seed, result_type stream) { gen.seed(seed, stream); cache = false; } template<> -void random_64bit_wrapper::seed(result_type seed, result_type stream) { +inline void random_64bit_wrapper::seed(result_type seed, result_type stream) { gen.seed(seed); gen.set_counter(0, 0, 0, stream); cache = false; diff --git a/inst/include/xoshiro.h b/inst/include/xoshiro.h index 1b22e77..6bed6ae 100644 --- a/inst/include/xoshiro.h +++ b/inst/include/xoshiro.h @@ -13,6 +13,9 @@ #include #include +#include +#include +#include namespace dqrng { template