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/include/wasserstein.h | |
parent | 1607071fcd9d473eae295693fc97bee8c50d6a11 (diff) |
Remove duplicate points for Wasserstein-1
Diffstat (limited to 'geom_matching/wasserstein/include/wasserstein.h')
-rw-r--r-- | geom_matching/wasserstein/include/wasserstein.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/geom_matching/wasserstein/include/wasserstein.h b/geom_matching/wasserstein/include/wasserstein.h index fcc9e74..1d8f35b 100644 --- a/geom_matching/wasserstein/include/wasserstein.h +++ b/geom_matching/wasserstein/include/wasserstein.h @@ -40,6 +40,8 @@ derivative works thereof, in binary and source code form. namespace geom_ws { +using PairVector = std::vector<std::pair<double, double>>; + // get Wasserstein distance between two persistence diagrams double wassersteinDistVec(const std::vector<DiagramPoint>& A, const std::vector<DiagramPoint>& B, @@ -138,8 +140,9 @@ double wassersteinCost(PairContainer& A, PairContainer& B, const double q, const // fill in result with points from file fname // return false if file can't be opened // or error occurred while reading -bool readDiagramPointSet(const char* fname, std::vector<std::pair<double, double>>& result); -bool readDiagramPointSet(const std::string& fname, std::vector<std::pair<double, double>>& result); +bool readDiagramPointSet(const char* fname, PairVector& result); +bool readDiagramPointSet(const std::string& fname, PairVector& result); +void removeDuplicates(PairVector& dgmA, PairVector& dgmB); } // end of namespace geom_ws |