diff options
author | Arnur Nigmetov <a.nigmetov@gmail.com> | 2017-04-05 21:58:27 +0200 |
---|---|---|
committer | Arnur Nigmetov <a.nigmetov@gmail.com> | 2017-04-05 21:58:27 +0200 |
commit | 5cda650aa878a9b5929c65eb83f431e117d39811 (patch) | |
tree | 21504e49bdf716e8671b9bc1e18df4ba0c66be80 /geom_matching/wasserstein/example/wasserstein_dist.cpp | |
parent | 1607071fcd9d473eae295693fc97bee8c50d6a11 (diff) |
Remove duplicate points for Wasserstein-1
Diffstat (limited to 'geom_matching/wasserstein/example/wasserstein_dist.cpp')
-rw-r--r-- | geom_matching/wasserstein/example/wasserstein_dist.cpp | 8 |
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) { |