Gudhi  1.1.0
 All Classes Functions Typedefs Friends Groups Pages
Link_condition_valid_contraction.h
1  /* This file is part of the Gudhi Library. The Gudhi library
2  * (Geometric Understanding in Higher Dimensions) is a generic C++
3  * library for computational topology.
4  *
5  * Author(s): David Salinas
6  *
7  * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef GUDHI_LINK_CONDITION_VALID_CONTRACTION_H_
24 #define GUDHI_LINK_CONDITION_VALID_CONTRACTION_H_
25 
26 #include "gudhi/Utils.h"
27 #include "Valid_contraction_policy.h"
28 
29 
30 namespace Gudhi{
31 
32 namespace contraction {
33 
34 
39 template< typename EdgeProfile> class Link_condition_valid_contraction : public Valid_contraction_policy<EdgeProfile>{
40 public:
41  typedef typename EdgeProfile::Edge_handle Edge_handle;
42  typedef typename EdgeProfile::Point Point;
43  //typedef typename EdgeProfile::Edge_handle Edge_handle;
44  bool operator()(const EdgeProfile& profile,const boost::optional<Point>& placement) const override{
45  Edge_handle edge(profile.edge_handle());
46  DBGMSG("Link_condition_valid_contraction:",profile.complex().link_condition(edge));
47  return profile.complex().link_condition(edge);
48  }
49 };
50 } // namespace contraction
51 
52 } // namespace GUDHI
53 
54 #endif /* GUDHI_LINK_CONDITION_VALID_CONTRACTION_H_ */
Policy to specify if an edge contraction is valid or not.
Definition: Valid_contraction_policy.h:33