mirror of https://github.com/CGAL/cgal
fix shortest_non_loop_edge
This commit is contained in:
parent
bf2e6c72f7
commit
4b626a3fe7
|
|
@ -202,7 +202,7 @@ public:
|
||||||
*/
|
*/
|
||||||
double shortest_loop() const;
|
double shortest_loop() const;
|
||||||
/*!
|
/*!
|
||||||
\return a `double` approximation of the length of the shortest non-loop edge in the Delaunay triangulation.
|
\return a `double` approximation of the length of the shortest non-loop edge in the Delaunay triangulation. Returns 0 (NULL) if all edges are loops.
|
||||||
*/
|
*/
|
||||||
double shortest_non_loop_edge() const;
|
double shortest_non_loop_edge() const;
|
||||||
/// @}
|
/// @}
|
||||||
|
|
|
||||||
|
|
@ -1094,6 +1094,7 @@ Delaunay_triangulation_on_hyperbolic_surface_2<Traits>::
|
||||||
shortest_non_loop_edge() const
|
shortest_non_loop_edge() const
|
||||||
{
|
{
|
||||||
Number min_delta_length = 999;
|
Number min_delta_length = 999;
|
||||||
|
double res = NULL;
|
||||||
for (typename Edge_const_range::const_iterator it = this->combinatorial_map_.template one_dart_per_cell<1>().begin();
|
for (typename Edge_const_range::const_iterator it = this->combinatorial_map_.template one_dart_per_cell<1>().begin();
|
||||||
it != this->combinatorial_map_.template one_dart_per_cell<1>().end(); ++it) {
|
it != this->combinatorial_map_.template one_dart_per_cell<1>().end(); ++it) {
|
||||||
Anchor const & current_anchor = anchor(it);
|
Anchor const & current_anchor = anchor(it);
|
||||||
|
|
@ -1112,10 +1113,11 @@ shortest_non_loop_edge() const
|
||||||
}
|
}
|
||||||
if(!is_loop) {
|
if(!is_loop) {
|
||||||
Number delta_length = delta(a, b);
|
Number delta_length = delta(a, b);
|
||||||
min_delta_length = min(min_delta_length,delta_length);
|
min_delta_length = min(min_delta_length, delta_length);
|
||||||
|
res = std::acosh(1 + to_double(min_delta_length));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return std::acosh(1 + to_double(min_delta_length));
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ int main()
|
||||||
assert(same_vertices);
|
assert(same_vertices);
|
||||||
|
|
||||||
assert(dt.shortest_loop() != 0);
|
assert(dt.shortest_loop() != 0);
|
||||||
assert(dt.shortest_non_loop_edge() != 0);
|
assert(dt.shortest_non_loop_edge() == 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
assert(is_eps_net);
|
assert(is_eps_net);
|
||||||
assert(dt.is_valid());
|
assert(dt.is_valid());
|
||||||
|
assert(dt.shortest_non_loop_edge() != 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue