diff options
author | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-30 06:35:42 +0000 |
---|---|---|
committer | fgodi <fgodi@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-06-30 06:35:42 +0000 |
commit | 4dfa2f897553c172fa142ceb72bca8667a247996 (patch) | |
tree | ab03ce41f5bdbd03f8927b759c0d54f56d41908f /src | |
parent | 936b0edbee931d8145729e08bbde2b053c82e637 (diff) |
test2
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/bottleneckDistance@663 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 7bff8467274d6c4177d8c6e9dc58f5276ca2a550
Diffstat (limited to 'src')
-rw-r--r-- | src/Bipartite_graph_matching/include/gudhi/Grid_cell.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Bipartite_graph_matching/include/gudhi/Grid_cell.h b/src/Bipartite_graph_matching/include/gudhi/Grid_cell.h index e9cf08b9..6a970b16 100644 --- a/src/Bipartite_graph_matching/include/gudhi/Grid_cell.h +++ b/src/Bipartite_graph_matching/include/gudhi/Grid_cell.h @@ -63,7 +63,10 @@ private: Corner_tree xi_yd_order; Corner_tree xd_yi_order; Corner_tree xd_yd_order; - void remove_aux(Corner_tree t, int v_point_index); + void remove_aux(Corner_tree t, int v_point_index, bool reverse); + template <typename Contiguous_tree t> + int pull_contiguous_aux(); + int pull_corner_aux(); void build_xi_yi(); void build_xi_yd(); void build_xd_yi(); @@ -83,7 +86,7 @@ inline bool Grid_cell::contains(int v_point_index) const{ return (xi_order.count(v_point_index) > 0); } -inline void Grid_cell::remove_aux(Corner_tree t, int v_point_index){ +inline void Grid_cell::remove_aux(Corner_tree t, int v_point_index, bool reverse){ if(t.empty()) return; std::list<Hidden_points_tree> hidden_points = t.at(v_point_index); @@ -102,6 +105,21 @@ inline void Grid_cell::remove(int v_point_index){ remove_aux(xd_yd_order,v_point_index); } +template <typename Contiguous_tree t> +inline int Grid_cell::pull_contiguous_aux(Contiguous_tree t, bool reverse){ + if(xi_order.empty()) + return null_point_index(); + if(t.empty()) + for(auto it = xi_order.begin(); it!= xi_order.end(); ++it) + t.emplace(*it); + int v_point_index = reverse ? *(t.rbegin()) : *(t.begin()); + if(G::distance(u_point_index,v_point_index)<=r){ + remove(v_point_index); + return v_point_index; + } + return null_point_index(); +} + //factorization needed \/ \/ \/ inline int Grid_cell::pull_center(){ |