mirror of https://github.com/CGAL/cgal
fix furthest orthogonal incremental neighbor
previously the current distance was always larger than the initial one. As a result no branch of the tree could be filtered out and all the nodes were visited.
This commit is contained in:
parent
ccaa1729ca
commit
6ec27d359e
|
|
@ -174,7 +174,7 @@ namespace CGAL {
|
|||
else{
|
||||
distance_to_root=
|
||||
Orthogonal_distance_instance.max_distance_to_rectangle(q,
|
||||
tree.bounding_box());
|
||||
tree.bounding_box(), dists);
|
||||
Node_with_distance *The_Root = new Node_with_distance(tree.root(),
|
||||
distance_to_root, dists);
|
||||
PriorityQueue.push(The_Root);
|
||||
|
|
@ -372,10 +372,9 @@ namespace CGAL {
|
|||
FT diff1 = val - node->upper_low_value();
|
||||
FT diff2 = val - node->lower_high_value();
|
||||
if (diff1 + diff2 < FT(0.0)) {
|
||||
diff1 = val - node->upper_high_value();
|
||||
new_rd=
|
||||
Orthogonal_distance_instance.new_distance(copy_rd,dst,diff1,new_cut_dim);
|
||||
|
||||
CGAL_assertion(new_rd >= copy_rd);
|
||||
Node_with_distance *Lower_Child =
|
||||
new Node_with_distance(node->lower(), copy_rd, dists);
|
||||
PriorityQueue.push(Lower_Child);
|
||||
|
|
@ -385,8 +384,8 @@ namespace CGAL {
|
|||
|
||||
}
|
||||
else { // compute new distance
|
||||
diff2 = val - node->lower_low_value();
|
||||
new_rd=Orthogonal_distance_instance.new_distance(copy_rd,dst,diff2,new_cut_dim);
|
||||
CGAL_assertion(new_rd >= copy_rd);
|
||||
Node_with_distance *Upper_Child =
|
||||
new Node_with_distance(node->upper(), copy_rd, dists);
|
||||
PriorityQueue.push(Upper_Child);
|
||||
|
|
|
|||
Loading…
Reference in New Issue