summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Internal_point.h
diff options
context:
space:
mode:
authorfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-02 17:09:48 +0000
committerfgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-06-02 17:09:48 +0000
commit3b5b94c90c81ae4938a89b2b4df8b1173f100ee3 (patch)
treecc8b30bdfc815ed239fffd5d902220789179d73d /src/Bottleneck_distance/include/gudhi/Internal_point.h
parent8f455abec0d349949960eaefdd0aedd8dff8e7ca (diff)
renaming
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneckDistance@1240 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 53bcbf20e176a21dc41ef3c4d4295b1e9aa959b0
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Internal_point.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Internal_point.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Internal_point.h b/src/Bottleneck_distance/include/gudhi/Internal_point.h
new file mode 100644
index 00000000..2080900d
--- /dev/null
+++ b/src/Bottleneck_distance/include/gudhi/Internal_point.h
@@ -0,0 +1,74 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Francois Godi
+ *
+ * Copyright (C) 2015 INRIA Sophia-Antipolis (France)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SRC_BOTTLENECK_INCLUDE_GUDHI_INTERNAL_POINT_H_
+#define SRC_BOTTLENECK_INCLUDE_GUDHI_INTERNAL_POINT_H_
+
+namespace Gudhi {
+
+namespace Bottleneck_distance {
+
+/** \internal \brief Returns the used index for encoding none of the points */
+int null_point_index();
+
+/** \internal \typedef \brief Internal_point is the internal points representation, indexes used outside. */
+struct Internal_point {
+ double vec[2];
+ int point_index;
+ Internal_point() {}
+ Internal_point(double x, double y, int p_i = null_point_index()) { vec[0]=x; vec[1]=y; point_index = p_i; }
+ double x() const { return vec[ 0 ]; }
+ double y() const { return vec[ 1 ]; }
+ double& x() { return vec[ 0 ]; }
+ double& y() { return vec[ 1 ]; }
+ bool operator==(const Internal_point& p) const
+ {
+ return point_index==p.point_index;
+ }
+ bool operator!=(const Internal_point& p) const { return ! (*this == p); }
+/*
+Useless
+ friend void swap(Internal_point& a, Internal_point& b)
+ {
+ using std::swap;
+ double x_tmp = a.vec[0];
+ double y_tmp = a.vec[1];
+ int pi_tmp = a.point_index;
+ a.vec[0] = b.vec[0];
+ a.vec[1] = b.vec[1];
+ a.point_index = b.point_index;
+ b.vec[0] = x_tmp;
+ b.vec[1] = y_tmp;
+ b.point_index = pi_tmp;
+ }
+*/
+};
+
+inline int null_point_index() {
+ return -1;
+}
+
+} // namespace Bottleneck_distance
+
+} // namespace Gudhi
+
+#endif // SRC_BOTTLENECK_INCLUDE_GUDHI_INTERNAL_POINT_H_