diff options
author | Arnur Nigmetov <a.nigmetov@gmail.com> | 2016-09-05 13:32:05 +0200 |
---|---|---|
committer | Arnur Nigmetov <a.nigmetov@gmail.com> | 2016-09-05 13:32:05 +0200 |
commit | 7b850b8ee43fb7f8a0b2a1565ed01102d40b0a14 (patch) | |
tree | 171852c6acd2c8be4390c53a52debf70ca4930b3 /geom_matching/wasserstein/src/basic_defs.cpp | |
parent | d1cf630f193cff61c83999600550634032ed1739 (diff) |
Technical changes for R integration
Avoid including iostream (R complains about that). All output protected by
preprocessor directive (R checker should not see an instance of std::cout << in
your code). Also added getWassersteinCost to be in line with the Dionysus
implementation used in TDA.
Diffstat (limited to 'geom_matching/wasserstein/src/basic_defs.cpp')
-rw-r--r-- | geom_matching/wasserstein/src/basic_defs.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/geom_matching/wasserstein/src/basic_defs.cpp b/geom_matching/wasserstein/src/basic_defs.cpp index d228123..a46e6aa 100644 --- a/geom_matching/wasserstein/src/basic_defs.cpp +++ b/geom_matching/wasserstein/src/basic_defs.cpp @@ -30,6 +30,10 @@ derivative works thereof, in binary and source code form. #include <set> #include "basic_defs_ws.h" +#ifndef FOR_R_TDA +#include <iostream> +#endif + namespace geom_ws { // Point @@ -43,11 +47,14 @@ bool Point::operator!=(const Point& other) const return !(*this == other); } + +#ifndef FOR_R_TDA std::ostream& operator<<(std::ostream& output, const Point p) { output << "(" << p.x << ", " << p.y << ")"; return output; } +#endif double sqrDist(const Point& a, const Point& b) { @@ -97,6 +104,7 @@ double distLp(const DiagramPoint& a, const DiagramPoint& b, const double p) } +#ifndef FOR_R_TDA std::ostream& operator<<(std::ostream& output, const DiagramPoint p) { if ( p.type == DiagramPoint::DIAG ) { @@ -106,7 +114,7 @@ std::ostream& operator<<(std::ostream& output, const DiagramPoint p) } return output; } - +#endif DiagramPoint::DiagramPoint(double xx, double yy, Type ttype) : x(xx), |