Skip to content

Commit bdf564b

Browse files
committedMar 27, 2024
Fix random_seed with normal distribution
1 parent e5e5fc1 commit bdf564b

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed
 

‎Makefile

-10
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ install: clean install-cpp install-py
179179

180180
uninstall: uninstall-cpp uninstall-py
181181

182-
develop-install-py: develop-uninstall-py all
183-
$(MAKE) develop-install -C $(PYTHON_PACKAGE_DIR)
184-
185-
develop-uninstall-py:
186-
$(MAKE) develop-uninstall -C $(PYTHON_PACKAGE_DIR)
187-
188182
$(BINDEST_DIR):
189183
mkdir $(BINDEST_DIR)
190184

@@ -198,10 +192,6 @@ clean:
198192
-rm -rf $(OBJDIR) trackcpp trackcpp-debug .depend *.out *.dat *~ *.o *.a
199193
$(MAKE) clean -C $(PYTHON_PACKAGE_DIR)
200194

201-
cleanall: clean
202-
cd tracking_mp; make clean;
203-
204-
205195
#### RULES ####
206196

207197
*.cpp: VERSION

‎include/trackcpp/auxiliary.h

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ int sgn(T val) {
199199

200200

201201
void set_random_seed(unsigned rnd_seed);
202+
void set_random_seed_with_random_device();
202203
void set_random_distribution(unsigned value);
203204
double gen_random_number();
204205

‎src/auxiliary.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,15 @@ void set_random_distribution(unsigned value){
3333
}
3434

3535
void set_random_seed(unsigned rnd_seed) {
36+
distr_gauss.reset();
3637
generator.seed(rnd_seed);
3738
}
3839

40+
void set_random_seed_with_random_device() {
41+
distr_gauss.reset();
42+
generator.seed(rand_dev());
43+
}
44+
3945
double gen_random_number() {
4046
if (choosen_distribution==Distributions::uniform){
4147
return distr_uniform(generator);

0 commit comments

Comments
 (0)