From fcd48b45c75dde8ae95819866edf7de1085762ce Mon Sep 17 00:00:00 2001 From: mcarrier Date: Thu, 1 Nov 2018 16:22:18 +0000 Subject: corrected typo on gudhi check git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/kernels@3972 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 189918d46ac4ddcfc85977f192ceb5ca569a2a8a --- src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Persistence_representations') diff --git a/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h b/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h index 8fc4bd15..5d0f4a5d 100644 --- a/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h +++ b/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h @@ -143,7 +143,7 @@ class Sliced_Wasserstein { // Evaluation of the Sliced Wasserstein Distance between a pair of diagrams. double compute_sliced_wasserstein_distance(const Sliced_Wasserstein & second) const { - GUDHI_CHECK(this->approx != second.approx, std::invalid_argument("Error: different approx values for representations")); + GUDHI_CHECK(this->approx == second.approx, std::invalid_argument("Error: different approx values for representations")); Persistence_diagram diagram1 = this->diagram; Persistence_diagram diagram2 = second.diagram; double sw = 0; @@ -283,7 +283,7 @@ class Sliced_Wasserstein { * */ double compute_scalar_product(const Sliced_Wasserstein & second) const { - GUDHI_CHECK(this->sigma != second.sigma, std::invalid_argument("Error: different sigma values for representations")); + GUDHI_CHECK(this->sigma == second.sigma, std::invalid_argument("Error: different sigma values for representations")); return std::exp(-compute_sliced_wasserstein_distance(second)/(2*this->sigma*this->sigma)); } @@ -295,7 +295,7 @@ class Sliced_Wasserstein { * */ double distance(const Sliced_Wasserstein & second) const { - GUDHI_CHECK(this->sigma != second.sigma, std::invalid_argument("Error: different sigma values for representations")); + GUDHI_CHECK(this->sigma == second.sigma, std::invalid_argument("Error: different sigma values for representations")); return std::pow(this->compute_scalar_product(*this) + second.compute_scalar_product(second)-2*this->compute_scalar_product(second), 0.5); } -- cgit v1.2.3