diff --git a/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp b/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp index e2c8384402f..a37756a682c 100644 --- a/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp +++ b/Surface_mesh_shortest_path/benchmark/Surface_mesh_shortest_path/benchmark_shortest_paths.cpp @@ -152,9 +152,9 @@ typename Traits::Barycentric_coordinates random_coordinates(CGAL::Random& rand) { typedef typename Traits::FT FT; typename Traits::Construct_barycentric_coordinates construct_barycentric_coordinates; - FT u = rand.uniform_real(FT(0.0), FT(1.0)); - FT v = rand.uniform_real(FT(0.0), FT(1.0) - u); - return construct_barycentric_coordinates(u, v, FT(1.0) - u - v); + FT u = rand.uniform_real(FT(0), FT(1)); + FT v = rand.uniform_real(FT(0), FT(1) - u); + return construct_barycentric_coordinates(u, v, FT(1) - u - v); } template diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index 21cd602837a..d228e69a32a 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -739,7 +739,7 @@ private: Barycentric_coordinates rotatedFaceLocation(shifted_coordinates(faceLocation, currentVertex)); Point_2 sourcePoint(construct_barycenter_in_triangle_2(layoutFace, rotatedFaceLocation)); - Cone_tree_node* child = new Cone_tree_node(m_traits, m_graph, current, layoutFace, sourcePoint, FT(0.0), cv2(layoutFace, 0), cv2(layoutFace, 2), Cone_tree_node::FACE_SOURCE); + Cone_tree_node* child = new Cone_tree_node(m_traits, m_graph, current, layoutFace, sourcePoint, FT(0), cv2(layoutFace, 0), cv2(layoutFace, 2), Cone_tree_node::FACE_SOURCE); node_created(); faceRoot->push_middle_child(child); @@ -800,7 +800,7 @@ private: std::cout << "\t\tLocation = " << sourcePoints[side] << std::endl; } - Cone_tree_node* mainChild = new Cone_tree_node(m_traits, m_graph, baseEdges[side], layoutFaces[side], sourcePoints[side], FT(0.0), cv2(layoutFaces[side], 0), cv2(layoutFaces[side], 1), Cone_tree_node::EDGE_SOURCE); + Cone_tree_node* mainChild = new Cone_tree_node(m_traits, m_graph, baseEdges[side], layoutFaces[side], sourcePoints[side], FT(0), cv2(layoutFaces[side], 0), cv2(layoutFaces[side], 1), Cone_tree_node::EDGE_SOURCE); node_created(); edgeRoot->push_middle_child(mainChild); process_node(mainChild); @@ -822,7 +822,7 @@ private: node_created(); m_rootNodes.push_back(std::make_pair(vertexRoot, sourcePointIt)); - m_closestToVertices[get(m_vertexIndexMap, vertex)] = Node_distance_pair(vertexRoot, FT(0.0)); + m_closestToVertices[get(m_vertexIndexMap, vertex)] = Node_distance_pair(vertexRoot, FT(0)); expand_pseudo_source(vertexRoot); } @@ -920,7 +920,7 @@ private: std::cout << "\tLeft is completely covered." << std::endl; } leftPoint = cs2(segment); - leftT = FT(0.0); + leftT = FT(0); } else { @@ -939,7 +939,7 @@ private: Point_2* result = boost::get(&*cgalIntersection); FT t0 = pdas2(cs2(segment), ct2(segment), *result); - if (t0 >= FT(1.00000)) + if (t0 >= FT(1)) { if (m_debugOutput) { @@ -948,7 +948,7 @@ private: return false; } - else if (t0 <= FT(0.00000)) + else if (t0 <= FT(0)) { if (m_debugOutput) { @@ -956,7 +956,7 @@ private: } leftPoint = cs2(segment); - leftT = FT(0.0); + leftT = FT(0); } else { @@ -980,7 +980,7 @@ private: std::cout << "Right is completely covered." << std::endl; } rightPoint = ct2(segment); - rightT = FT(1.0); + rightT = FT(1); } else { @@ -999,7 +999,7 @@ private: Point_2* result = boost::get(&*cgalIntersection); FT t0 = pdas2(cs2(segment), ct2(segment), *result); - if (t0 <= FT(0.00000)) + if (t0 <= FT(0)) { if (m_debugOutput) { @@ -1007,14 +1007,14 @@ private: } return false; } - else if (t0 >= FT(1.00000)) + else if (t0 >= FT(1)) { if (m_debugOutput) { std::cout << "\tRight is completely covered (secondary check). " << t0 << std::endl; } rightPoint = ct2(segment); - rightT = FT(1.0); + rightT = FT(1); } else { @@ -1522,9 +1522,9 @@ private: { Cone_tree_node* null_value=NULL; m_closestToVertices.resize(num_vertices(m_graph)); - std::fill(m_closestToVertices.begin(), m_closestToVertices.end(), Node_distance_pair(null_value, FT(0.0))); + std::fill(m_closestToVertices.begin(), m_closestToVertices.end(), Node_distance_pair(null_value, FT(0))); m_vertexOccupiers.resize(num_halfedges(m_graph)); - std::fill(m_vertexOccupiers.begin(), m_vertexOccupiers.end(), Node_distance_pair(null_value, FT(0.0))); + std::fill(m_vertexOccupiers.begin(), m_vertexOccupiers.end(), Node_distance_pair(null_value, FT(0))); while (!m_expansionPriqueue.empty()) { @@ -1716,7 +1716,7 @@ private: } else { - return std::make_pair(Node_distance_pair((Cone_tree_node*)NULL, FT(0.0)), cbc(FT(0.0), FT(0.0), FT(0.0))); + return std::make_pair(Node_distance_pair((Cone_tree_node*)NULL, FT(0)), cbc(FT(0), FT(0), FT(0))); } } @@ -1749,7 +1749,7 @@ private: { std::size_t oppositeIndex = internal::edge_index(oppositeHalfedge, m_graph); - FT oppositeLocationCoords[3] = { FT(0.0), FT(0.0), FT(0.0) }; + FT oppositeLocationCoords[3] = { FT(0), FT(0), FT(0) }; oppositeLocationCoords[oppositeIndex] = cbcw(location, (associatedEdge + 1) % 3); oppositeLocationCoords[(oppositeIndex + 1) % 3] = cbcw(location, associatedEdge); Barycentric_coordinates oppositeLocation(cbc(oppositeLocationCoords[0], oppositeLocationCoords[1], oppositeLocationCoords[2])); @@ -1783,7 +1783,7 @@ private: vertex_descriptor vertex = source(he, m_graph); - return std::make_pair(m_closestToVertices[get(m_vertexIndexMap, vertex)], cbc(FT(0.0), FT(0.0), FT(1.0))); + return std::make_pair(m_closestToVertices[get(m_vertexIndexMap, vertex)], cbc(FT(0), FT(0), FT(1))); } break; @@ -2279,7 +2279,7 @@ public: } else { - return std::make_pair(FT(-1.0), source_points_end()); + return std::make_pair(FT(-1), source_points_end()); } } @@ -2307,7 +2307,7 @@ public: } else { - return std::make_pair(FT(-1.0), source_points_end()); + return std::make_pair(FT(-1), source_points_end()); } } @@ -2349,7 +2349,7 @@ public: } else { - return std::make_pair(FT(-1.0), source_points_end()); + return std::make_pair(FT(-1), source_points_end()); } } @@ -2388,7 +2388,7 @@ public: } else { - return std::make_pair(FT(-1.0), source_points_end()); + return std::make_pair(FT(-1), source_points_end()); } } @@ -2553,9 +2553,9 @@ public: face_descriptor locationFace = face(he, tm); std::size_t edgeIndex = CGAL::internal::edge_index(he, tm); - FT coords[3] = { FT(0.0), FT(0.0), FT(0.0) }; + FT coords[3] = { FT(0), FT(0), FT(0) }; - coords[edgeIndex] = FT(1.0); + coords[edgeIndex] = FT(1); return Face_location(locationFace, construct_barycentric_coordinates(coords[0], coords[1], coords[2])); } @@ -2584,9 +2584,9 @@ public: face_descriptor locationFace = face(he, tm); std::size_t edgeIndex = CGAL::internal::edge_index(he, tm); - const FT oneMinusT(FT(1.0) - t); + const FT oneMinusT(FT(1) - t); - FT coords[3] = { FT(0.0), FT(0.0), FT(0.0) }; + FT coords[3] = { FT(0), FT(0), FT(0) }; coords[edgeIndex] = oneMinusT; coords[(edgeIndex + 1) % 3] = t; @@ -2766,7 +2766,7 @@ public: } else { - return Face_location(Graph_traits::null_face(), cbc(FT(0.0), FT(0.0), FT(0.0))); + return Face_location(Graph_traits::null_face(), cbc(FT(0), FT(0), FT(0))); } } diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/barycentric.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/barycentric.h index 4c9d0f60a45..c6d9bbc2535 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/barycentric.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/barycentric.h @@ -81,7 +81,7 @@ public: FT v = (d11 * d20 - d01 * d21) / denom; FT w = (d00 * d21 - d01 * d20) / denom; - return m_construct_barycentric_coordinates(FT(1.0) - v - w, v, w); + return m_construct_barycentric_coordinates(FT(1) - v - w, v, w); } }; @@ -132,7 +132,7 @@ public: FT v = (d11 * d20 - d01 * d21) / denom; FT w = (d00 * d21 - d01 * d20) / denom; - return m_construct_barycentric_coordinates(FT(1.0) - v - w, v, w); + return m_construct_barycentric_coordinates(FT(1) - v - w, v, w); } }; diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h index 524a426676b..75bf7b37ea9 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/function_objects.h @@ -372,7 +372,7 @@ public: Vector_2 edgeVector(m_construct_vector_2(segment)); Vector_2 perpendicularEdgeVector(m_construct_perpendicular_vector_2(edgeVector, CGAL::COUNTERCLOCKWISE)); - perpendicularEdgeVector = m_construct_scaled_vector_2(perpendicularEdgeVector, FT(1.0) / CGAL::internal::select_sqrt(m_compute_squared_length_2(perpendicularEdgeVector))); + perpendicularEdgeVector = m_construct_scaled_vector_2(perpendicularEdgeVector, FT(1) / CGAL::internal::select_sqrt(m_compute_squared_length_2(perpendicularEdgeVector))); Point_2 points[3]; points[edgeIndex] = m_construct_source_2(segment); @@ -479,7 +479,7 @@ public: if (!p1_ptr) return CGAL::SMALLER; CGAL_assertion_code(FT t1 = m_parametric_distance_along_segment_2(s1, *p1_ptr);) - CGAL_assertion(t1 >= FT(-0.00001) && t1 <= FT(1.00001)); + CGAL_assertion(t1 >= FT(-1)/FT(100000) && t1 <= FT(1)+FT(1)/FT(100000)); LineLineIntersectResult intersectResult2 = m_intersect_2(s2Line, l2); CGAL_assertion(bool(intersectResult2)); @@ -491,7 +491,7 @@ public: if (!p2_ptr) return CGAL::SMALLER; CGAL_assertion_code(FT t2 = m_parametric_distance_along_segment_2(s2, *p2_ptr);) - CGAL_assertion(t2 >= FT(-0.00001) && t2 <= FT(1.00001)); + CGAL_assertion(t1 >= FT(-1)/FT(100000) && t1 <= FT(1)+FT(1)/FT(100000)); return m_compare_distance_2(s1.source(), *p1_ptr, s2.source(), *p2_ptr); }