Skip to content

Commit

Permalink
Explicitly include required std headers for xoshiro.
Browse files Browse the repository at this point in the history
Inline template specializations for correct linking, fixes daqana#28.
  • Loading branch information
LTLA authored and rstub committed May 13, 2019
1 parent 5e7dd26 commit 2b1ef06
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions inst/include/dqrng_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<pcg64>::seed(result_type seed, result_type stream) {
inline void random_64bit_wrapper<pcg64>::seed(result_type seed, result_type stream) {
gen.seed(seed, stream);
cache = false;
}

template<>
void random_64bit_wrapper<sitmo::threefry_20_64>::seed(result_type seed, result_type stream) {
inline void random_64bit_wrapper<sitmo::threefry_20_64>::seed(result_type seed, result_type stream) {
gen.seed(seed);
gen.set_counter(0, 0, 0, stream);
cache = false;
Expand Down
3 changes: 3 additions & 0 deletions inst/include/xoshiro.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

#include <array>
#include <cstdint>
#include <functional>
#include <algorithm>
#include <type_traits>

namespace dqrng {
template<size_t N, int_fast8_t A, int_fast8_t B, int_fast8_t C>
Expand Down

0 comments on commit 2b1ef06

Please sign in to comment.