Skip to content

Commit

Permalink
fixed narrowing conversion from int to std::size_t in constructor, wh…
Browse files Browse the repository at this point in the history
…ich caused apple-clang to select a random seed also when a fixed one is supplied
  • Loading branch information
AlePalu committed Dec 5, 2023
1 parent d197e82 commit 609eeb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fdaPDE/models/regression/stochastic_edf.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class StochasticEDF {
DMatrix<double> Us_; // sample from Rademacher distribution
DMatrix<double> Bs_; // \Psi^T*Q*Us_
DMatrix<double> 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) { }
Expand Down

0 comments on commit 609eeb3

Please sign in to comment.