fix dimension() of a singular simplex

This commit is contained in:
Laurent Rineau 2023-06-18 21:20:56 +02:00
parent e936fcb36b
commit 8a6f8f2c06
1 changed files with 4 additions and 1 deletions

View File

@ -96,8 +96,10 @@ public:
// returns the dimension of the simplex
int dimension () const {
return (ref & 3);
if(ref == -1) return -1;
else return (ref & 3);
}
// returns an incident cell:
Cell_handle incident_cell() {
return ch;
@ -161,6 +163,7 @@ operator==(Triangulation_simplex_3<TriangulationDataStructure_3> s0,
typename Sim::Cell_handle neighbor;
switch (s0.dimension()) {
case -1: return s1.dimension() == -1;
case (0): // Vertex
return (s0.ch->vertex(s0.index(0)) == s1.ch->vertex(s1.index(0)));
case (1): // Edge