Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra boost #86

Merged
merged 3 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/revdepcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
"revdep",
repos = "https://cloud.r-project.org/")
tools::check_packages_in_dir("revdep",
check_args = "--as-cran --no-manual",
check_args = "--no-manual",
Ncpus = 4)
tools::summarize_check_packages_in_dir_results("revdep")

Expand Down
12 changes: 7 additions & 5 deletions inst/include/dqrng_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@
#include <dqrng_types.h>
#include <xoshiro.h>
#include <pcg_random.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <Rcpp.h>
#include <convert_seed.h>
#include <R_randgen.h>

#if defined(__cpp_lib_make_unique) && (__cpp_lib_make_unique >= 201304)
using std::make_unique;
#else
#include <boost/smart_ptr/make_unique.hpp>
using boost::make_unique;
template<typename T, typename... Args>
std::unique_ptr<T> make_unique(Args&&... args) {
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
#endif

namespace dqrng {
Expand Down Expand Up @@ -102,10 +103,11 @@ inline void random_64bit_wrapper<::dqrng::xoshiro256starstar>::set_stream(result
template<>
inline void random_64bit_wrapper<pcg64>::set_stream(result_type stream) {
// set the stream relative to the current stream, i.e. stream = 0 does not change the RNG
boost::multiprecision::uint128_t number;
std::vector<boost::multiprecision::uint128_t> state;
pcg_extras::pcg128_t number;
std::vector<pcg_extras::pcg128_t> state;
std::stringstream iss;
iss << gen;
using pcg_extras::operator>>;
while (iss >> number)
state.push_back(number);
// state[1] is the current stream
Expand Down
Loading