diff options
author | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-12 15:22:45 +0000 |
---|---|---|
committer | mcarrier <mcarrier@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-04-12 15:22:45 +0000 |
commit | 905be209a0e62121c125c37e01f4d2eae5aa606d (patch) | |
tree | de48475b4c0e45936f6cc2b655851f0cbc552fbc /src/cython/include/Kernels_interface.h | |
parent | 860fa7d916cb591cb0b016b046077d5333570731 (diff) |
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3378 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 7cd9f2ae7c9da5d525bdb76a00ffac1359a47da7
Diffstat (limited to 'src/cython/include/Kernels_interface.h')
-rw-r--r-- | src/cython/include/Kernels_interface.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/cython/include/Kernels_interface.h b/src/cython/include/Kernels_interface.h index 33cd6e35..1742d016 100644 --- a/src/cython/include/Kernels_interface.h +++ b/src/cython/include/Kernels_interface.h @@ -53,24 +53,22 @@ namespace persistence_diagram { double pss(const std::vector<std::pair<double, double>>& diag1, const std::vector<std::pair<double, double>>& diag2, double sigma, int N) { - double pi = boost::math::constants::pi<double>(); std::vector<std::pair<double, double>> pd1 = diag1; int numpts = diag1.size(); for(int i = 0; i < numpts; i++) pd1.emplace_back(diag1[i].second,diag1[i].first); std::vector<std::pair<double, double>> pd2 = diag2; numpts = diag2.size(); for(int i = 0; i < numpts; i++) pd2.emplace_back(diag2[i].second,diag2[i].first); Gudhi::Persistence_representations::Persistence_weighted_gaussian pwg1(pd1, 2*std::sqrt(sigma), N, Gudhi::Persistence_representations::Persistence_weighted_gaussian::pss_weight); Gudhi::Persistence_representations::Persistence_weighted_gaussian pwg2(pd2, 2*std::sqrt(sigma), N, Gudhi::Persistence_representations::Persistence_weighted_gaussian::pss_weight); - return pwg1.compute_scalar_product (pwg2) / (16*pi*sigma); + return pwg1.compute_scalar_product (pwg2) / (16*Gudhi::Persistence_representations::pi*sigma); } double pss_sym(const std::vector<std::pair<double, double>>& diag1, const std::vector<std::pair<double, double>>& diag2, double sigma, int N) { - double pi = boost::math::constants::pi<double>(); Gudhi::Persistence_representations::Persistence_weighted_gaussian pwg1(diag1, 2*std::sqrt(sigma), N, Gudhi::Persistence_representations::Persistence_weighted_gaussian::pss_weight); Gudhi::Persistence_representations::Persistence_weighted_gaussian pwg2(diag2, 2*std::sqrt(sigma), N, Gudhi::Persistence_representations::Persistence_weighted_gaussian::pss_weight); - return pwg1.compute_scalar_product (pwg2) / (16*pi*sigma); + return pwg1.compute_scalar_product (pwg2) / (16*Gudhi::Persistence_representations::pi*sigma); } |