summaryrefslogtreecommitdiff
path: root/src/Bottleneck_distance/include/gudhi/Internal_point.h
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-04 08:39:18 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-01-04 08:39:18 +0000
commit64dd2a2b0eec1374ed23ca079f86b312125d03f7 (patch)
treef22c13edb5f6d2980c0af4ec21a6a9b8910990de /src/Bottleneck_distance/include/gudhi/Internal_point.h
parent67c34d7b506efe6445a24380b3ad0743e09ef334 (diff)
Move bottleneck_chrono in benchmark
Add test in cmake for basic example Move CGAL gudhi patches for bottleneck in dedicated directory Fix cpplint syntax issue git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneck_integration@1920 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 24671facf791de93dc6fd94bb39ca7362bb22959
Diffstat (limited to 'src/Bottleneck_distance/include/gudhi/Internal_point.h')
-rw-r--r--src/Bottleneck_distance/include/gudhi/Internal_point.h69
1 files changed, 45 insertions, 24 deletions
diff --git a/src/Bottleneck_distance/include/gudhi/Internal_point.h b/src/Bottleneck_distance/include/gudhi/Internal_point.h
index 70342d0c..0b2d26fe 100644
--- a/src/Bottleneck_distance/include/gudhi/Internal_point.h
+++ b/src/Bottleneck_distance/include/gudhi/Internal_point.h
@@ -4,7 +4,7 @@
*
* Author: Francois Godi
*
- * Copyright (C) 2015 INRIA (France)
+ * Copyright (C) 2015 INRIA
*
* 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
@@ -32,39 +32,60 @@ 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) { 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); }
+ double vec[2];
+ int point_index;
+
+ Internal_point() { }
+
+ Internal_point(double x, double y, int p_i) {
+ 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);
+ }
};
inline int null_point_index() {
- return -1;
+ return -1;
}
struct Construct_coord_iterator {
- typedef const double* result_type;
- const double* operator()(const Internal_point& p) const
- { return p.vec; }
- const double* operator()(const Internal_point& p, int) const
- { return p.vec+2; }
+ typedef const double* result_type;
+
+ const double* operator()(const Internal_point& p) const {
+ return p.vec;
+ }
+
+ const double* operator()(const Internal_point& p, int) const {
+ return p.vec + 2;
+ }
};
} // namespace persistence_diagram
} // namespace Gudhi
-
-
-
-
#endif // INTERNAL_POINT_H_