summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/include/wasserstein.h
diff options
context:
space:
mode:
authorArnur Nigmetov <a.nigmetov@gmail.com>2018-01-25 10:33:41 +0100
committerArnur Nigmetov <a.nigmetov@gmail.com>2018-01-25 10:33:41 +0100
commite77514fbcb7e8aa2d91747e95e1250820d223bae (patch)
treebcb7f751d7c48a751756487d0d8f1088f04ff754 /geom_matching/wasserstein/include/wasserstein.h
parent0cc35ad04f9c2997014d7cf62a12f697e79fb534 (diff)
Fix for inf-only diagrams
Diffstat (limited to 'geom_matching/wasserstein/include/wasserstein.h')
-rw-r--r--geom_matching/wasserstein/include/wasserstein.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/geom_matching/wasserstein/include/wasserstein.h b/geom_matching/wasserstein/include/wasserstein.h
index d843a04..b90a545 100644
--- a/geom_matching/wasserstein/include/wasserstein.h
+++ b/geom_matching/wasserstein/include/wasserstein.h
@@ -228,6 +228,9 @@ namespace ws
throw std::runtime_error("Bad epsilon factor in Wasserstein " + std::to_string(params.epsilon_common_ratio));
}
+ if (A.empty() and B.empty())
+ return 0.0;
+
RealType result;
// just use Gauss-Seidel