summaryrefslogtreecommitdiff
path: root/geom_matching/wasserstein/example/wasserstein_dist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'geom_matching/wasserstein/example/wasserstein_dist.cpp')
-rw-r--r--geom_matching/wasserstein/example/wasserstein_dist.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/geom_matching/wasserstein/example/wasserstein_dist.cpp b/geom_matching/wasserstein/example/wasserstein_dist.cpp
index c699282..a2ed234 100644
--- a/geom_matching/wasserstein/example/wasserstein_dist.cpp
+++ b/geom_matching/wasserstein/example/wasserstein_dist.cpp
@@ -39,11 +39,9 @@ derivative works thereof, in binary and source code form.
// any container of pairs of doubles can be used,
// we use vector in this example.
-typedef std::vector<std::pair<double, double>> PairVector;
-
int main(int argc, char* argv[])
{
- PairVector diagramA, diagramB;
+ geom_ws::PairVector diagramA, diagramB;
if (argc < 3 ) {
std::cerr << "Usage: " << argv[0] << " file1 file2 [wasserstein_degree] [relative_error] [internal norm] [output_actual_error]. By default power is 1.0, relative error is 0.01, internal norm is l_infinity, actual relative error is not printed." << std::endl;
@@ -64,6 +62,10 @@ int main(int argc, char* argv[])
std::exit(1);
}
+ if (wasserPower == 1.0) {
+ geom_ws::removeDuplicates(diagramA, diagramB);
+ }
+
//default relative error: 1%
double delta = (5 <= argc) ? atof(argv[4]) : 0.01;
if ( delta <= 0.0) {