cheshirekow  v0.1.0
induced_subcomplex.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
26 #ifndef EDELSBRUNNER96_INDUCED_SUBCOMPLEX_H_
27 #define EDELSBRUNNER96_INDUCED_SUBCOMPLEX_H_
28 
29 #include <array>
30 #include <set>
31 
32 namespace edelsbrunner96 {
33 
37 
73 template <typename Traits>
75  public:
76  typedef typename Traits::Scalar Scalar;
77  typedef typename Traits::Storage Storage;
78  typedef typename Traits::PointRef PointRef;
79  typedef typename Traits::SimplexRef SimplexRef;
80  typedef typename Traits::Simplex Simplex;
81 
87 
89  : s_ref(s_ref),
90  v_missing(v_missing) {
91  }
92  };
93 
95  std::array<PointRef, Traits::NDim + 2> V;
96 
99  std::array<SimplexRef, Traits::NDim + 2> S;
100 
102  std::array<PointRef, Traits::NDim> f;
103 
106  std::array<PointRef, 2> e;
107 
109  std::array<SimplexRef, 2> s;
110 
113  void Init(Storage& storage, SimplexRef s0_ref, SimplexRef s1_ref);
114 
117  void Init(Storage& storage, const std::array<SimplexRef, 2>& s);
118 
120  bool IsLocallyRegular(Storage& storage);
121 
124  void Build(Storage& storage);
125 
127 
131  bool IsFlippable(Storage& storage);
132 
136  uint8_t FindIndexOfPeakVertex(Simplex& s);
137 
139  void Flip(Storage& storage);
140 };
141 
142 } // namespace edelsbrunner96
143 
144 #endif // EDELSBRUNNER96_INDUCED_SUBCOMPLEX_H_
std::array< SimplexRef, 2 > s
the two simplices bounding the facet
bool IsFlippable(Storage &storage)
Return true if the facet is flippable.
uint8_t FindIndexOfPeakVertex(Simplex &s)
Given a simplex s which borders the hull of V (i.e. s shares a facet with hull(V)), then find the vertex of s which is not in V, and return it's index in S.V;.
BreadthFirstNode(SimplexRef s_ref, PointRef v_missing)
The induced subcomplex of a facet between two simplices is the set of all simplices in the triangulat...
std::array< PointRef, Traits::NDim > f
the vertices of facet for which this subcomplex is induced.
std::array< SimplexRef, Traits::NDim+2 > S
if S[i] is not null then it is the simplex in the triangulation composed of all the vertices in V exc...
bool IsLocallyRegular(Storage &storage)
Return true if the facet is locally regular.
void Build(Storage &storage)
Fill the induced simplex by breadth-first search of the neighborhood about s[0] and s[1]...
std::array< PointRef, Traits::NDim+2 > V
the (sorted) vertices of the subcomplex
std::array< PointRef, 2 > e
the two vertices in V which are not part of the facet. e[i] is the vertex missing from s[i] ...
void Init(Storage &storage, SimplexRef s0_ref, SimplexRef s1_ref)
Initialize the data structure with the two simplices and build the vertex set for the common facet...
We do a breadthfirst search for simplices in the induced subcomplex. This data structure is what we q...
void Flip(Storage &storage)
Flip the subcomplex.