From 609eeb3d0f5e38f52cc25ec79e1078b721c21c5e Mon Sep 17 00:00:00 2001 From: AlePalu Date: Tue, 5 Dec 2023 12:50:22 +0100 Subject: [PATCH] fixed narrowing conversion from int to std::size_t in constructor, which caused apple-clang to select a random seed also when a fixed one is supplied --- fdaPDE/models/regression/stochastic_edf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fdaPDE/models/regression/stochastic_edf.h b/fdaPDE/models/regression/stochastic_edf.h index f464039e..f9707487 100644 --- a/fdaPDE/models/regression/stochastic_edf.h +++ b/fdaPDE/models/regression/stochastic_edf.h @@ -35,11 +35,11 @@ class StochasticEDF { DMatrix Us_; // sample from Rademacher distribution DMatrix Bs_; // \Psi^T*Q*Us_ DMatrix Y_; // Us_^T*\Psi - std::size_t seed_; + int seed_; bool init_ = false; public: // constructor - StochasticEDF(std::size_t r, std::size_t seed) : + StochasticEDF(std::size_t r, int seed) : r_(r), seed_((seed == fdapde::random_seed) ? std::random_device()() : seed) { } StochasticEDF(std::size_t r) : StochasticEDF(r, std::random_device()()) { } StochasticEDF() : StochasticEDF(100) { }