23 #ifndef SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_ 24 #define SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_ 32 namespace skeleton_blocker {
34 template<
typename SimplexHandle>
35 std::list<SimplexHandle> subfaces(SimplexHandle top_face) {
36 std::list<SimplexHandle> res;
37 if (top_face.dimension() == -1)
return res;
38 if (top_face.dimension() == 0) {
39 res.push_back(top_face);
42 auto first_vertex = top_face.first_vertex();
43 top_face.remove_vertex(first_vertex);
44 res = subfaces(top_face);
45 std::list<SimplexHandle> copy = res;
46 for (
auto& simplex : copy) {
47 simplex.add_vertex(first_vertex);
49 res.push_back(SimplexHandle(first_vertex));
50 res.splice(res.end(), copy);
58 template<
typename SimplexHandle>
59 void register_faces(std::vector< std::set<SimplexHandle> >& simplices_per_dimension,
60 const SimplexHandle& top_face) {
61 std::list<SimplexHandle> subfaces_list = subfaces(top_face);
62 for (
auto& simplex : subfaces_list) {
63 simplices_per_dimension[simplex.dimension()].insert(simplex);
69 namespace skbl = skeleton_blocker;
73 #endif // SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_ Definition: SimplicialComplexForAlpha.h:26