diff options
author | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-10-30 21:07:52 +0000 |
---|---|---|
committer | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-10-30 21:07:52 +0000 |
commit | 230eac46395aeb406ca79280a8d62fc35b6f41a3 (patch) | |
tree | 21d1feab9f3d090cba3313b73dead9db5fc0a6bc /src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h | |
parent | 8f9e4f64a2df82205a3a4551e0443b9e2a45edae (diff) |
removed template Kernel2D
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3965 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 0cfdece6eb19cb8601371bc96e1dbb66ae41a086
Diffstat (limited to 'src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h')
-rw-r--r-- | src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h b/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h index 79fe8690..a0191dd7 100644 --- a/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h +++ b/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h @@ -163,10 +163,11 @@ class Sliced_Wasserstein { // Slightly perturb the points so that the PDs are in generic positions. double thresh_y = max_ordinate * 0.00001; double thresh_x = max_abscissa * 0.00001; - srand(time(NULL)); + std::random_device rd; std::default_random_engine re(rd()); std::uniform_real_distribution<double> uni(-1,1); + double epsilon = uni(re); for (int i = 0; i < num_pts_dgm; i++){ - diagram1[i].first += thresh_x*(1.0-2.0*rand()/RAND_MAX); diagram1[i].second += thresh_y*(1.0-2.0*rand()/RAND_MAX); - diagram2[i].first += thresh_x*(1.0-2.0*rand()/RAND_MAX); diagram2[i].second += thresh_y*(1.0-2.0*rand()/RAND_MAX); + diagram1[i].first += thresh_x*epsilon; diagram1[i].second += thresh_y*epsilon; + diagram2[i].first += thresh_x*epsilon; diagram2[i].second += thresh_y*epsilon; } // Compute all angles in both PDs. |