Gudhi::contraction::Skeleton_blocker_contractor< GeometricSimplifiableComplex, EdgeProfile > Class Template Reference

Class that allows to contract iteratively edges of a simplicial complex. More...

Public Member Functions

void contract_edges (int num_max_contractions=-1)
 Contract edges. More...
 
boost::optional< std::pair< Edge_handle, Placement_type > > top_edge ()
 Returns an Edge_handle and a Placement_type. This pair consists in the edge with the lowest cost in the heap together with its placement. The returned value is initialized iff the heap is non-empty.
 
 Skeleton_blocker_contractor (GeometricSimplifiableComplex &complex)
 Constructor with default policies. More...
 
 Skeleton_blocker_contractor (GeometricSimplifiableComplex &complex, Cost_policy_ *cost_policy, Placement_policy_ *placement_policy=new First_vertex_placement< Profile >, Valid_contraction_policy_ *valid_contraction_policy=new Link_condition_valid_contraction< Profile >, Contraction_visitor_ *contraction_visitor=new Contraction_visitor_(), Edge_profile_factory_ *edge_profile_factory=NULL)
 Constructor with customed policies. More...
 

Detailed Description

template<class GeometricSimplifiableComplex, class EdgeProfile = Edge_profile<GeometricSimplifiableComplex>>
class Gudhi::contraction::Skeleton_blocker_contractor< GeometricSimplifiableComplex, EdgeProfile >

Class that allows to contract iteratively edges of a simplicial complex.

The simplification algorithm consists in iteratively picking the edge with lowest cost and performing an edge contraction if the contraction is valid. This class is policy based (and much inspired from the edge collapse package of CGAL http://doc.cgal.org/latest/Surface_mesh_simplification/index.html).

Policies that can be changed are :

  • the cost policy : how much cost an edge contraction
  • the placement policy : where will be placed the contraction point
  • the valid contraction policy : is the contraction valid. For instance, it can be a topological condition (link condition) or a geometrical condition (normals messed up).
Examples:
Contraction/Garland_heckbert.cpp, and Contraction/Rips_contraction.cpp.

Constructor & Destructor Documentation

◆ Skeleton_blocker_contractor() [1/2]

template<class GeometricSimplifiableComplex , class EdgeProfile = Edge_profile<GeometricSimplifiableComplex>>
Gudhi::contraction::Skeleton_blocker_contractor< GeometricSimplifiableComplex, EdgeProfile >::Skeleton_blocker_contractor ( GeometricSimplifiableComplex &  complex)
inline

Constructor with default policies.

The default cost, placement, valid and visitor policies are respectively : the edge length, the first point, the link condition

◆ Skeleton_blocker_contractor() [2/2]

template<class GeometricSimplifiableComplex , class EdgeProfile = Edge_profile<GeometricSimplifiableComplex>>
Gudhi::contraction::Skeleton_blocker_contractor< GeometricSimplifiableComplex, EdgeProfile >::Skeleton_blocker_contractor ( GeometricSimplifiableComplex &  complex,
Cost_policy_ cost_policy,
Placement_policy_ placement_policy = new First_vertex_placement<Profile>,
Valid_contraction_policy_ valid_contraction_policy = new Link_condition_valid_contraction<Profile>,
Contraction_visitor_ contraction_visitor = new Contraction_visitor_(),
Edge_profile_factory_ *  edge_profile_factory = NULL 
)
inline

Constructor with customed policies.

Remarks
Policies destruction is handle by the class with smart pointers.

Member Function Documentation

◆ contract_edges()

template<class GeometricSimplifiableComplex , class EdgeProfile = Edge_profile<GeometricSimplifiableComplex>>
void Gudhi::contraction::Skeleton_blocker_contractor< GeometricSimplifiableComplex, EdgeProfile >::contract_edges ( int  num_max_contractions = -1)
inline

Contract edges.

While the heap is not empty, it extracts the edge with the minimum cost in the heap then try to contract it. It stops when the Stop policy says so or when the number of contractions given by 'num_max_contractions' is reached (if this number is positive).


The documentation for this class was generated from the following file:
GUDHI  Version 3.1.1  - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding.  - Copyright : MIT Generated on Fri Feb 7 2020 16:35:36 for GUDHI by Doxygen 1.8.13