23 #ifndef GUDHI_SKELETON_BLOCKER_COMPLEX_H
24 #define GUDHI_SKELETON_BLOCKER_COMPLEX_H
36 #include <boost/graph/adjacency_list.hpp>
37 #include <boost/graph/connected_components.hpp>
38 #include <boost/iterator/transform_iterator.hpp>
39 #include <boost/range/adaptor/map.hpp>
41 #include "gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h"
42 #include "gudhi/Skeleton_blocker_link_complex.h"
43 #include "gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h"
44 #include "gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h"
45 #include "gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h"
47 #include "gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h"
48 #include "gudhi/Skeleton_blocker/internal/Top_faces.h"
49 #include "gudhi/Utils.h"
62 template<
class SkeletonBlockerDS>
66 template<
class ComplexType>
friend class Complex_neighbors_vertices_iterator;
68 template<
class ComplexType>
friend class Complex_edge_around_vertex_iterator;
93 typedef typename Root_vertex_handle::boost_vertex_handle boost_vertex_handle;
110 typedef typename Root_simplex_handle::Simplex_vertex_const_iterator Root_simplex_iterator;
111 typedef typename Simplex_handle::Simplex_vertex_const_iterator Simplex_handle_iterator;
116 typedef typename boost::adjacency_list
129 typedef typename boost::graph_traits<Graph>::vertex_iterator boost_vertex_iterator;
130 typedef typename boost::graph_traits<Graph>::edge_iterator boost_edge_iterator;
133 typedef typename boost::graph_traits<Graph>::adjacency_iterator boost_adjacency_iterator;
139 typedef typename boost::graph_traits<Graph>::edge_descriptor
Edge_handle;
143 typedef std::multimap<Vertex_handle,Simplex_handle *> BlockerMap;
144 typedef typename std::multimap<Vertex_handle,Simplex_handle *>::value_type BlockerPair;
145 typedef typename std::multimap<Vertex_handle,Simplex_handle *>::iterator BlockerMapIterator;
146 typedef typename std::multimap<Vertex_handle,Simplex_handle *>::const_iterator BlockerMapConstIterator;
164 std::vector<boost_vertex_handle> degree_;
171 BlockerMap blocker_map_;
190 for (
int i=0; i<num_vertices_; ++i){
202 class Simplices_sets_from_list{
204 typedef std::set< Simplex_handle> Container_simplices;
205 typedef typename Container_simplices::iterator Simplices_iterator;
207 std::vector<Container_simplices > simplices_;
210 Simplices_sets_from_list(std::list<Simplex_handle>& simplices):
212 assert(!simplices.empty());
214 for(
auto simplex = simplices.begin() ; simplex != simplices.end(); ++simplex ){
215 dimension_ = std::max(dimension_,(
int)simplex->dimension());
217 simplices_ = std::vector<Container_simplices >(dimension_+1);
220 for(
auto simplex = simplices.begin() ; simplex != simplices.end(); ++simplex ){
221 simplices_[simplex->dimension()].insert(*simplex);
225 Simplices_iterator begin(
int k){
226 assert(0<= k && k<= dimension_);
227 return simplices_[k].begin();
230 Simplices_iterator end(
int k){
231 assert(0<= k && k<= dimension_);
232 return simplices_[k].end();
236 Container_simplices& simplices(
int k){
237 return simplices_[k];
244 bool contains(
const Simplex_handle& simplex)
const{
245 if(simplex.dimension()>dimension_)
248 return simplices_[simplex.dimension()].find(simplex)!= simplices_[simplex.dimension()].end();
252 for(
int i = 0; i < dimension_; ++i){
253 std::cout << i<<
"-simplices"<<std::endl;
254 auto l = simplices_[i];
256 std::cout << s<<std::endl;
263 void compute_next_expand(
264 Simplices_sets_from_list& simplices,
266 std::list<Simplex_handle>& next_expand)
273 for(
auto sigma = simplices.begin(dim); sigma != simplices.end(dim); ++sigma){
275 Simplex_handle t(*sigma);
276 Skeleton_blocker_link_superior<Skeleton_blocker_complex> link(*
this,t);
282 for(
auto v : link.vertex_range()){
283 Vertex_handle v_in_complex(*this->
get_address( link.get_id(v)) );
284 t.add_vertex(v_in_complex);
285 next_expand.push_back(t);
286 t.remove_vertex(v_in_complex);
304 num_vertices_(0),num_blockers_(0),
306 Simplices_sets_from_list set_simplices(simplices);
308 int dim = set_simplices.dimension();
312 for(
auto v_it = set_simplices.begin(0); v_it != set_simplices.end(0); ++v_it)
315 for(
auto e_it = set_simplices.begin(1); e_it != set_simplices.end(1); ++e_it){
318 assert(contains_vertex(a) && contains_vertex(b));
323 for(
int current_dim = 1 ; current_dim <=dim ; ++current_dim){
324 std::list<Simplex_handle> expansion_simplices;
325 compute_next_expand(set_simplices,current_dim,expansion_simplices);
327 for(
const auto &simplex : expansion_simplices) {
328 if(!set_simplices.contains(simplex)){
340 degree_ = copy.degree_;
341 skeleton = Graph(copy.skeleton);
342 num_vertices_ = copy.num_vertices_;
356 degree_ = copy.degree_;
357 skeleton = Graph(copy.skeleton);
358 num_vertices_ = copy.num_vertices_;
362 for (
auto blocker : copy.const_blocker_range())
397 visitor = other_visitor;
427 assert(0<=address.vertex && address.vertex< boost::num_vertices(skeleton));
428 return skeleton[address.vertex];
436 assert(0<=address.vertex && address.vertex< boost::num_vertices(skeleton));
437 return skeleton[address.vertex];
446 (*this)[address].activate();
450 degree_.push_back(0);
451 if (visitor) visitor->on_add_vertex(address);
462 assert(contains_vertex(address));
464 boost::clear_vertex(address.vertex,skeleton);
465 (*this)[address].deactivate();
467 degree_[address.vertex]=-1;
468 if (visitor) visitor->on_remove_vertex(address);
473 bool contains_vertex(Vertex_handle u)
const{
474 if (u.vertex<0 || u.vertex>=boost::num_vertices(skeleton))
return false;
475 return (*
this)[u].is_active();
481 boost::optional<Vertex_handle> address =
get_address(u);
482 return address && (*this)[*address].is_active();
491 for (
auto vertex : sigma)
492 if(!contains_vertex(vertex))
return false;
501 boost::optional<Vertex_handle> res;
502 if (
id.vertex< boost::num_vertices(skeleton) ) res =
Vertex_handle(
id.vertex);
512 assert(0<=local.vertex && local.vertex< boost::num_vertices(skeleton));
513 return (*
this)[local].get_id();
530 assert(vh_in_current_complex);
531 return *vh_in_current_complex;
538 assert(0<=local.vertex && local.vertex< boost::num_vertices(skeleton));
539 return degree_[local.vertex];
555 boost::optional<Edge_handle>
operator[](
const std::pair<Vertex_handle,Vertex_handle>& ab)
const{
556 boost::optional<Edge_handle> res;
557 std::pair<Edge_handle,bool> edge_pair(boost::edge(ab.first.vertex,ab.second.vertex,skeleton));
558 if (edge_pair.second)
559 res = edge_pair.first;
567 return skeleton[edge_handle];
574 return skeleton[edge_handle];
582 return source(edge_handle,skeleton);
590 return target(edge_handle,skeleton);
599 auto edge((*
this)[edge_handle]);
600 return Simplex_handle((*
this)[edge.first()],(*this)[edge.second()]);
607 assert(contains_vertex(a) && contains_vertex(b));
610 auto edge_handle((*
this)[std::make_pair(a,b)]);
616 edge_handle = boost::add_edge(a.vertex,b.vertex,skeleton).first;
620 if (visitor) visitor->on_add_edge(a,b);
629 Simplex_handle_iterator i, j;
630 for (i = sigma.begin() ; i != sigma.end() ; ++i)
631 for (j = i, j++ ; j != sigma.end() ; ++j)
642 tie(edge,found) = boost::edge(a.vertex,b.vertex,skeleton);
645 if (visitor) visitor->on_remove_edge(a,b);
647 boost::remove_edge(a.vertex,b.vertex,skeleton);
673 while (this->
degree(u)> 0)
675 Vertex_handle v(*(adjacent_vertices(u.vertex, this->skeleton).first));
688 return boost::edge(a.vertex,b.vertex,skeleton).second;
697 for (
auto i = sigma.begin() ; i != sigma.end() ; ++i){
698 if(!contains_vertex(*i))
return false;
699 for (
auto j=i; ++j != sigma.end() ; ){
727 if (visitor) visitor->on_add_blocker(blocker);
730 auto vertex = blocker_pt->begin();
731 while(vertex != blocker_pt->end())
733 blocker_map_.insert(BlockerPair(*vertex,blocker_pt));
751 if (visitor) visitor->on_add_blocker(*blocker);
753 auto vertex = blocker->begin();
754 while(vertex != blocker->end())
756 blocker_map_.insert(BlockerPair(*vertex,blocker));
768 Complex_blocker_around_vertex_iterator blocker;
773 if (*blocker == sigma)
break;
775 if (*blocker != sigma){
776 std::cerr <<
"bug ((*blocker).second == sigma) ie try to remove a blocker not present\n";
780 blocker_map_.erase(blocker.current_position());
790 for (
auto vertex : *sigma){
791 remove_blocker(sigma,vertex);
805 while (!blocker_map_.empty()){
809 blocker_map_.clear();
819 void remove_blocker(
const Simplex_handle& sigma){
821 for (
auto vertex : sigma)
822 remove_blocker(sigma,vertex);
835 if (visitor) visitor->on_delete_blocker(sigma);
836 remove_blocker(sigma);
879 bool blocks(
const Simplex_handle & sigma)
const{
882 if ( sigma.contains(*blocker) )
897 virtual void add_neighbours(Vertex_handle v, Simplex_handle & n,
bool keep_only_superior=
false)
const{
898 boost_adjacency_iterator ai, ai_end;
899 for (tie(ai, ai_end) = adjacent_vertices(v.vertex, skeleton); ai != ai_end; ++ai){
900 if (keep_only_superior){
917 virtual void add_neighbours(
const Simplex_handle &alpha, Simplex_handle & res,
bool keep_only_superior=
false)
const{
919 auto alpha_vertex = alpha.begin();
920 add_neighbours(*alpha_vertex,res,keep_only_superior);
921 for (alpha_vertex = (alpha.begin())++ ; alpha_vertex != alpha.end() ; ++alpha_vertex)
922 keep_neighbours(*alpha_vertex,res,keep_only_superior);
930 virtual void keep_neighbours(Vertex_handle v, Simplex_handle& res,
bool keep_only_superior=
false)
const{
932 add_neighbours(v,nv,keep_only_superior);
933 res.intersection(nv);
941 virtual void remove_neighbours(Vertex_handle v, Simplex_handle & res,
bool keep_only_superior=
false)
const{
943 add_neighbours(v,nv,keep_only_superior);
959 boost::optional<Simplex_handle> res;
963 for (
auto i = s.begin() ; i != s.end() ; ++i)
965 boost::optional<Vertex_handle> address =
get_address(*i);
981 for (
auto x = local_simplex.begin(); x!= local_simplex.end();++x){
985 return global_simplex;
1008 return num_vertices()==0;
1014 int num_vertices()
const{
1016 return num_vertices_;
1024 int num_edges()
const{
1025 return boost::num_edges(skeleton);
1031 int num_blockers()
const{
1032 return num_blockers_;
1038 bool complete()
const{
1039 return (num_vertices()*(num_vertices()-1))/2 == num_edges();
1046 int num_vert_collapsed = skeleton.vertex_set().size() - num_vertices();
1047 std::vector<int> component(skeleton.vertex_set().size());
1048 return boost::connected_components(this->skeleton,&component[0]) - num_vert_collapsed;
1056 if (num_vertices()==0)
return false;
1057 if (num_vertices()==1)
return true;
1060 if (blocker_map_.find(vi)==blocker_map_.end()){
1063 if (degree_[vi.vertex] == num_vertices()-1)
1096 typedef boost::iterator_range < Complex_neighbors_vertices_iterator<Skeleton_blocker_complex> > Complex_neighbors_vertices_range;
1103 auto begin = Complex_neighbors_vertices_iterator<Skeleton_blocker_complex>(
this,v);
1104 auto end = Complex_neighbors_vertices_iterator<Skeleton_blocker_complex>(
this,v,0);
1105 return Complex_neighbors_vertices_range(begin,end);
1116 typedef boost::iterator_range <Complex_edge_iterator<Skeleton_blocker_complex<SkeletonBlockerDS>>>
1126 return Complex_edge_range(begin,end);
1131 typedef boost::iterator_range <Complex_edge_around_vertex_iterator<Skeleton_blocker_complex<SkeletonBlockerDS>>>
1132 Complex_edge_around_vertex_range;
1139 auto begin = Complex_edge_around_vertex_iterator<Skeleton_blocker_complex<SkeletonBlockerDS>>(
this,v);
1140 auto end = Complex_edge_around_vertex_iterator<Skeleton_blocker_complex<SkeletonBlockerDS>>(
this,v,0);
1141 return Complex_edge_around_vertex_range(begin,end);
1159 typedef boost::iterator_range < Triangle_around_vertex_iterator<Skeleton_blocker_complex,Link> > Complex_triangle_around_vertex_range;
1170 return Complex_triangle_around_vertex_range(begin,end);
1174 typedef boost::iterator_range<Triangle_iterator<Skeleton_blocker_complex> > Complex_triangle_range;
1185 return Complex_triangle_range(end,end);
1189 return Complex_triangle_range(begin,end);
1215 assert(contains_vertex(v));
1223 typedef Simplex_iterator<Skeleton_blocker_complex> Complex_simplex_iterator;
1225 typedef boost::iterator_range < Complex_simplex_iterator > Complex_simplex_range;
1232 Complex_simplex_iterator end(
this,
true);
1234 return Complex_simplex_range(end,end);
1237 Complex_simplex_iterator begin(
this);
1238 return Complex_simplex_range(begin,end);
1254 typename std::multimap<Vertex_handle,Simplex_handle *>::iterator,
1256 Complex_blocker_around_vertex_iterator;
1262 typename std::multimap<Vertex_handle,Simplex_handle *>::const_iterator,
1264 Const_complex_blocker_around_vertex_iterator;
1266 typedef boost::iterator_range <Complex_blocker_around_vertex_iterator> Complex_blocker_around_vertex_range;
1267 typedef boost::iterator_range <Const_complex_blocker_around_vertex_iterator> Const_complex_blocker_around_vertex_range;
1279 return Complex_blocker_around_vertex_range(begin,end);
1289 return Const_complex_blocker_around_vertex_range(begin,end);
1301 typename std::multimap<Vertex_handle,Simplex_handle *>::iterator,
1303 Complex_blocker_iterator;
1309 typename std::multimap<Vertex_handle,Simplex_handle *>::const_iterator,
1311 Const_complex_blocker_iterator;
1313 typedef boost::iterator_range <Complex_blocker_iterator> Complex_blocker_range;
1314 typedef boost::iterator_range <Const_complex_blocker_iterator> Const_complex_blocker_range;
1326 return Complex_blocker_range(begin,end);
1336 return Const_complex_blocker_range(begin,end);
1354 std::string to_string()
const{
1355 std::ostringstream stream;
1356 stream<<num_vertices()<<
" vertices:\n"<<vertices_to_string()<<std::endl;
1357 stream<<num_edges()<<
" edges:\n"<<edges_to_string()<<std::endl;
1358 stream<<num_blockers()<<
" blockers:\n"<<blockers_to_string()<<std::endl;
1359 return stream.str();
1362 std::string vertices_to_string()
const{
1363 std::ostringstream stream;
1365 stream <<
"("<<(*this)[vertex].get_id()<<
"),";
1367 return stream.str();
1370 std::string edges_to_string()
const{
1371 std::ostringstream stream;
1373 stream <<
"("<< (*this)[edge].first()<<
","<< (*this)[edge].second() <<
")"<<
" id = "<< (*this)[edge].index()<< std::endl;
1375 return stream.str();
1379 std::string blockers_to_string()
const{
1380 std::ostringstream stream;
1381 for (
auto bl:blocker_map_){
1382 stream << bl.first <<
" => " << bl.second <<
":"<<*bl.second <<
"\n";
1384 return stream.str();
1397 template<
typename Complex,
typename SimplexHandleIterator>
1398 unsigned make_complex_from_top_faces(Complex& complex,SimplexHandleIterator begin,SimplexHandleIterator end){
1399 typedef typename Complex::Simplex_handle Simplex_handle;
1402 for(
auto top_face = begin; top_face != end; ++top_face)
1403 dimension = std::max(dimension,top_face->dimension());
1405 std::vector< std::set<Simplex_handle> > simplices_per_dimension(dimension+1);
1408 for(
auto top_face = begin; top_face != end; ++top_face){
1409 register_faces(simplices_per_dimension,*top_face);
1413 std::list<Simplex_handle> simplices;
1414 for(
int dim = 0 ; dim <= dimension ; ++dim){
1416 simplices_per_dimension[dim].begin(),
1417 simplices_per_dimension[dim].end(),
1418 std::back_inserter(simplices)
1421 complex = Complex(simplices);
1422 return simplices.size();
void remove_blockers()
Remove all blockers, in other words, it expand the simplicial complex to the smallest flag complex th...
Definition: Skeleton_blocker_complex.h:803
void add_vertex(T v)
Definition: Skeleton_blocker_simplex.h:133
Const_complex_blocker_range const_blocker_range() const
Returns a range of the blockers of the complex.
Definition: Skeleton_blocker_complex.h:1332
void remove_blocker(const Blocker_handle sigma)
Removes the simplex from the set of blockers.
Definition: Skeleton_blocker_complex.h:789
bool contains_blocker(const Blocker_handle s) const
Definition: Skeleton_blocker_complex.h:844
Complex_triangle_range triangle_range() const
Range over triangles of the simplicial complex. Methods .begin() and .end() return a Triangle_around_...
Definition: Skeleton_blocker_complex.h:1181
void remove_edge(Edge_handle edge)
Removes edge and its cofaces from the simplicial complex.
Definition: Skeleton_blocker_complex.h:658
Blocker_handle add_blocker(const Simplex_handle &blocker)
Adds the simplex to the set of blockers and returns a Blocker_handle toward it if was not present bef...
Definition: Skeleton_blocker_complex.h:719
void set_visitor(Visitor *other_visitor)
allows to change the visitor.
Definition: Skeleton_blocker_complex.h:396
Class representing the link of a simplicial complex encoded by a skeleton/blockers pair...
Definition: Skeleton_blocker_link_complex.h:42
const Graph_vertex & operator[](Vertex_handle address) const
Return the vertex node associated to local Vertex_handle.
Definition: Skeleton_blocker_complex.h:435
Complex_blocker_range blocker_range()
Returns a range of the blockers of the complex.
Definition: Skeleton_blocker_complex.h:1322
Iterator on the edges of a simplicial complex.
Definition: Skeleton_blockers_edges_iterators.h:105
boost::optional< Edge_handle > operator[](const std::pair< Vertex_handle, Vertex_handle > &ab) const
return an edge handle if the two vertices forms an edge in the complex
Definition: Skeleton_blocker_complex.h:555
Class representing the link of a simplicial complex encoded by a skeleton/blockers pair...
Definition: Skeleton_blocker_link_superior.h:39
Vertex_handle second_vertex(Edge_handle edge_handle) const
returns the first vertex of an edge
Definition: Skeleton_blocker_complex.h:589
void delete_blocker(Blocker_handle sigma)
Definition: Skeleton_blocker_complex.h:834
SkeletonBlockerDS::Graph_vertex Graph_vertex
The type of stored vertex node, specified by the template SkeletonBlockerDS.
Definition: Skeleton_blocker_complex.h:80
boost::graph_traits< Graph >::edge_descriptor Edge_handle
Handle to an edge of the complex.
Definition: Skeleton_blocker_complex.h:139
Skeleton_blocker_complex(std::list< Simplex_handle > &simplices, Visitor *visitor_=NULL)
Constructor with a list of simplices.
Definition: Skeleton_blocker_complex.h:303
Complex_neighbors_vertices_range vertex_range(Vertex_handle v) const
Returns a Complex_edge_range over all edges of the simplicial complex that passes trough v...
Definition: Skeleton_blocker_complex.h:1101
Vertex_handle operator[](Root_vertex_handle global) const
Return a local Vertex_handle of a vertex given a global one.
Definition: Skeleton_blocker_complex.h:416
Vertex_handle first_vertex(Edge_handle edge_handle) const
returns the first vertex of an edge
Definition: Skeleton_blocker_complex.h:581
Iterator through the blockers of a vertex.
Definition: Skeleton_blockers_blockers_iterators.h:37
The type of edges that are stored the boost graph. An Edge must be Default Constructible and Equality...
Definition: SkeletonBlockerDS.h:97
Graph_vertex & operator[](Vertex_handle address)
Return the vertex node associated to local Vertex_handle.
Definition: Skeleton_blocker_complex.h:426
boost::iterator_range< Complex_vertex_iterator< Skeleton_blocker_complex > > Complex_vertex_range
Range over the vertices of the simplicial complex. Methods .begin() and .end() return a Complex_verte...
Definition: Skeleton_blocker_complex.h:1084
virtual boost::optional< Vertex_handle > get_address(Root_vertex_handle id) const
Given an Id return the address of the vertex having this Id in the complex.
Definition: Skeleton_blocker_complex.h:500
Const_complex_blocker_around_vertex_range const_blocker_range(Vertex_handle v) const
Returns a range of the blockers of the complex passing through a vertex.
Definition: Skeleton_blocker_complex.h:1285
Iterator over the triangles that are adjacent to a vertex of the simplicial complex.
Definition: Skeleton_blockers_triangles_iterators.h:39
int degree(Vertex_handle local) const
return the graph degree of a vertex.
Definition: Skeleton_blocker_complex.h:537
Abstract Simplicial Complex represented with a skeleton/blockers pair.
Definition: Skeleton_blocker_complex.h:63
Skeleton_blocker_complex(int num_vertices_=0, Visitor *visitor_=NULL)
constructs a simplicial complex with a given number of vertices and a visitor.
Definition: Skeleton_blocker_complex.h:188
Simplex_handle * Blocker_handle
Handle to a blocker of the complex.
Definition: Skeleton_blocker_complex.h:106
T first_vertex() const
Definition: Skeleton_blocker_simplex.h:235
Iterator on the vertices of a simplicial complex.
Definition: Skeleton_blockers_vertices_iterators.h:38
bool contains_edges(const Simplex_handle &sigma) const
Definition: Skeleton_blocker_complex.h:696
int num_connected_components() const
returns the number of connected components in the graph of the 1-skeleton.
Definition: Skeleton_blocker_complex.h:1045
Simplex_handle get_vertices(Edge_handle edge_handle) const
returns the simplex made with the two vertices of the edge
Definition: Skeleton_blocker_complex.h:598
virtual ~Skeleton_blocker_complex()
Definition: Skeleton_blocker_complex.h:371
Vertex_handle convert_handle_from_another_complex(const Skeleton_blocker_complex &other, Vertex_handle vh_in_other) const
Convert an address of a vertex of a complex to the address in the current complex.
Definition: Skeleton_blocker_complex.h:527
Edge_handle add_edge(Vertex_handle a, Vertex_handle b)
Adds an edge between vertices a and b and all its cofaces.
Definition: Skeleton_blocker_complex.h:606
Simplicial subcomplex of a complex represented by a skeleton/blockers pair.
Definition: Skeleton_blocker_link_superior.h:31
boost::optional< Simplex_handle > get_simplex_address(const Root_simplex_handle &s) const
Compute the local vertices of 's' in the current complex If one of them is not present in the complex...
Definition: Skeleton_blocker_complex.h:957
virtual void clear()
Definition: Skeleton_blocker_complex.h:380
Complex_vertex_range vertex_range() const
Returns a Complex_vertex_range over all vertices of the complex.
Definition: Skeleton_blocker_complex.h:1089
Root_vertex_handle get_id(Vertex_handle local) const
Definition: Skeleton_blocker_complex.h:511
void remove_vertex(Vertex_handle address)
Remove a vertex from the simplicial complex.
Definition: Skeleton_blocker_complex.h:461
Vertex that stores a point.
Definition: SkeletonBlockerGeometricDS.h:41
virtual Edge_handle remove_edge(Vertex_handle a, Vertex_handle b)
Removes an edge from the simplicial complex and all its cofaces.
Definition: Skeleton_blocker_complex.h:639
bool contains_edge(Vertex_handle a, Vertex_handle b) const
Definition: Skeleton_blocker_complex.h:686
Vertex_handle add_vertex()
Adds a vertex to the simplicial complex and returns its Vertex_handle.
Definition: Skeleton_blocker_complex.h:443
Abstract simplex used in Skeleton blockers data-structure.
Definition: Skeleton_blocker_simplex.h:48
Complex_simplex_range simplex_range() const
Returns a Complex_simplex_range over all the simplices of the complex.
Definition: Skeleton_blocker_complex.h:1230
SkeletonBlockerDS::Vertex_handle Vertex_handle
The type of an handle to a vertex of the complex.
Definition: Skeleton_blocker_complex.h:92
bool is_cone() const
Test if the complex is a cone.
Definition: Skeleton_blocker_complex.h:1055
Graph_edge & operator[](Edge_handle edge_handle)
returns the stored node associated to an edge
Definition: Skeleton_blocker_complex.h:566
Iterator through the blockers of a vertex.
Definition: Skeleton_blockers_blockers_iterators.h:91
Interface for a visitor of a simplicial complex.
Definition: Skeleton_blocker_complex_visitor.h:38
bool contains_blocker(const Simplex_handle &s) const
Definition: Skeleton_blocker_complex.h:860
Complex_triangle_around_vertex_range triangle_range(Vertex_handle v) const
Range over triangles around a vertex of the simplicial complex. Methods .begin() and ...
Definition: Skeleton_blocker_complex.h:1166
Skeleton_blocker_simplex< Vertex_handle > Simplex_handle
A ordered set of integers that represents a simplex.
Definition: Skeleton_blocker_complex.h:99
int dimension() const
Definition: Skeleton_blocker_simplex.h:222
Definition: Skeleton_blockers_simplices_iterators.h:53
void add_edges(const Simplex_handle &sigma)
Adds all edges and their cofaces of a simplex to the simplicial complex.
Definition: Skeleton_blocker_complex.h:628
Definition: SkeletonBlockerDS.h:60
SkeletonBlockerDS::Graph_edge Graph_edge
The type of stored edge node, specified by the template SkeletonBlockerDS.
Definition: Skeleton_blocker_complex.h:85
Complex_edge_around_vertex_range edge_range(Vertex_handle v) const
Returns a Complex_edge_range over all edges of the simplicial complex that passes through 'v'...
Definition: Skeleton_blocker_complex.h:1137
Root_simplex_handle get_id(const Simplex_handle &local_simplex) const
returns a simplex with vertices which are the id of vertices of the argument.
Definition: Skeleton_blocker_complex.h:979
The type of vertices that are stored the boost graph. A Vertex must be Default Constructible and Equa...
Definition: SkeletonBlockerDS.h:72
bool contains_vertices(const Simplex_handle &sigma) const
Definition: Skeleton_blocker_complex.h:490
Complex_simplex_around_vertex_range simplex_range(Vertex_handle v) const
Returns a Complex_simplex_around_vertex_range over all the simplices around a vertex of the complex...
Definition: Skeleton_blocker_complex.h:1213
boost::iterator_range< Complex_simplex_around_vertex_iterator > Complex_simplex_around_vertex_range
Range over the simplices of the simplicial complex around a vertex. Methods .begin() and ...
Definition: Skeleton_blocker_complex.h:1208
Root_vertex_handle and Vertex_handle are similar to global and local vertex descriptor used in boost ...
Definition: SkeletonBlockerDS.h:50
Complex_blocker_around_vertex_range blocker_range(Vertex_handle v)
Returns a range of the blockers of the complex passing through a vertex.
Definition: Skeleton_blocker_complex.h:1275
void keep_only_vertices()
The complex is reduced to its set of vertices. All the edges and blockers are removed.
Definition: Skeleton_blocker_complex.h:669
Iterator over the triangles of the simplicial complex.
Definition: Skeleton_blockers_triangles_iterators.h:122
virtual bool contains(const Simplex_handle &s) const
returns true iff the simplex s belongs to the simplicial complex.
Definition: Skeleton_blocker_complex.h:994
const Graph_edge & operator[](Edge_handle edge_handle) const
returns the stored node associated to an edge
Definition: Skeleton_blocker_complex.h:573
Complex_edge_range edge_range() const
Returns a Complex_edge_range over all edges of the simplicial complex.
Definition: Skeleton_blocker_complex.h:1122