From 2b7d774c36aae6ad4ab61ba9ba89aeb97538c5f7 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 28 Nov 2014 12:59:31 +0100 Subject: [PATCH] fix the convergence criterion --- Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h index 00a09331a9b..6bdb6431aaf 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Mesh_global_optimizer_2.h @@ -140,7 +140,7 @@ public: // Initialize big moves (stores the largest moves) big_moves_.clear(); std::size_t big_moves_size = (std::max)(std::size_t(1), - moving_vertices.size()/200); + moving_vertices.size()/100); big_moves_.resize(big_moves_size, FT(0)); std::size_t nb_vertices_moved = -1; @@ -277,14 +277,14 @@ private: if ( FT(0) == local_sq_size ) return CGAL::NULL_VECTOR; - FT local_move_sq_length = (move * move); + FT local_move_sq_ratio = (move * move) / local_sq_size; // Move point only if displacement is big enough w.r.t local size - if ( local_move_sq_length/local_sq_size < sq_freeze_ratio_ ) + if ( local_move_sq_ratio < sq_freeze_ratio_ ) return CGAL::NULL_VECTOR; // Update big moves - update_big_moves(local_move_sq_length); + update_big_moves(local_move_sq_ratio); return move; }