]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/algorithms/buffer/buffer_multi_point.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / buffer / buffer_multi_point.cpp
index fc83d758f0fb1a3d059d792dee038852ba58d7f7..1380151f388660774c39c7d350a085937bc1e635 100644 (file)
@@ -24,6 +24,8 @@ static std::string const grid_a = "MULTIPOINT(5 0,6 0,7 0,  5 1,7 1,  0 13,8 13)
 static std::string const mysql_report_2015_02_25_1 = "MULTIPOINT(-9 19,9 -6,-4 4,16 -14,-3 16,14 9)";
 static std::string const mysql_report_2015_02_25_2 = "MULTIPOINT(-2 11,-15 3,6 4,-14 0,20 -7,-17 -1)";
 
+static std::string const mysql_report_3 = "MULTIPOINT(0 0,0 0,0 0,0 0,0 0)";
+
 template <bool Clockwise, typename P>
 void test_all()
 {
@@ -40,23 +42,23 @@ void test_all()
 
     double const pi = boost::geometry::math::pi<double>();
 
-    test_one<multi_point_type, polygon>("simplex1", simplex, join, end_flat, 2.0 * pi, 1.0, 1.0);
-    test_one<multi_point_type, polygon>("simplex2", simplex, join, end_flat, 22.8372, 2.0, 2.0);
-    test_one<multi_point_type, polygon>("simplex3", simplex, join, end_flat, 44.5692, 3.0, 3.0);
+    test_one<multi_point_type, polygon>("simplex1", simplex, join, end_flat, 2.0 * pi, 1.0);
+    test_one<multi_point_type, polygon>("simplex2", simplex, join, end_flat, 22.8372, 2.0);
+    test_one<multi_point_type, polygon>("simplex3", simplex, join, end_flat, 44.5692, 3.0);
 
-    test_one<multi_point_type, polygon>("three1", three, join, end_flat, 3.0 * pi, 1.0, 1.0);
+    test_one<multi_point_type, polygon>("three1", three, join, end_flat, 3.0 * pi, 1.0);
 #if !defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
     // For no-rescaling, fails in CCW mode
-    test_one<multi_point_type, polygon>("three2", three, join, end_flat, 36.7592, 2.0, 2.0);
+    test_one<multi_point_type, polygon>("three2", three, join, end_flat, 36.7592, 2.0);
 #endif
-    test_one<multi_point_type, polygon>("three19", three, join, end_flat, 33.6914, 1.9, 1.9);
-    test_one<multi_point_type, polygon>("three21", three, join, end_flat, 39.6394, 2.1, 2.1);
-    test_one<multi_point_type, polygon>("three3", three, join, end_flat, 65.533, 3.0, 3.0);
+    test_one<multi_point_type, polygon>("three19", three, join, end_flat, 33.6914, 1.9);
+    test_one<multi_point_type, polygon>("three21", three, join, end_flat, 39.6394, 2.1);
+    test_one<multi_point_type, polygon>("three3", three, join, end_flat, 65.533, 3.0);
 
-    test_one<multi_point_type, polygon>("multipoint_a", multipoint_a, join, end_flat, 2049.98, 14.0, 14.0);
-    test_one<multi_point_type, polygon>("multipoint_b", multipoint_b, join, end_flat, 7109.88, 15.0, 15.0);
-    test_one<multi_point_type, polygon>("multipoint_b1", multipoint_b, join, end_flat, 6911.89, 14.7, 14.7);
-    test_one<multi_point_type, polygon>("multipoint_b2", multipoint_b, join, end_flat, 7174.79, 15.1, 15.1);
+    test_one<multi_point_type, polygon>("multipoint_a", multipoint_a, join, end_flat, 2049.98, 14.0);
+    test_one<multi_point_type, polygon>("multipoint_b", multipoint_b, join, end_flat, 7109.88, 15.0);
+    test_one<multi_point_type, polygon>("multipoint_b1", multipoint_b, join, end_flat, 6911.89, 14.7);
+    test_one<multi_point_type, polygon>("multipoint_b2", multipoint_b, join, end_flat, 7174.79, 15.1);
 
     // Grid tests
     {
@@ -77,7 +79,20 @@ void test_all()
     test_with_custom_strategies<multi_point_type, polygon>("mysql_report_2015_02_25_1_800",
             mysql_report_2015_02_25_1, join, end_flat,
             distance_strategy(6051788), side_strategy,
-            bg::strategy::buffer::point_circle(800), 115057490003226.125, 1.0);
+            bg::strategy::buffer::point_circle(800),
+            115057490003226.125, ut_settings(1.0));
+
+    {
+        multi_point_type g;
+        bg::read_wkt(mysql_report_3, g);
+        test_buffer<polygon>("mysql_report_3", g,
+            bg::strategy::buffer::join_round(36),
+            bg::strategy::buffer::end_round(36),
+            distance_strategy(1),
+            side_strategy,
+            bg::strategy::buffer::point_circle(36),
+            1, 0, 3.12566719800474635, ut_settings(1.0));
+    }
 }
 
 template <typename P>
@@ -103,11 +118,10 @@ void test_many_points_per_circle()
 
     using bg::strategy::buffer::point_circle;
 
-    double const tolerance = 1.0;
 #if defined(BOOST_GEOMETRY_NO_ROBUSTNESS)
-    double const tolerance_multiplier = 1000.0;
+    double const tolerance = 1000.0;
 #else
-    double const tolerance_multiplier = 1.0;
+    double const tolerance = 1.0;
 #endif
 
     // Area should be somewhat larger (~>) than pi*distance^2
@@ -118,7 +132,7 @@ void test_many_points_per_circle()
             "mysql_report_2015_02_25_1_8000",
             mysql_report_2015_02_25_1, join, end_flat,
             distance_strategy(6051788), side_strategy, point_circle(8000),
-            115058661065242.812, tolerance);
+            115058661065242.812, ut_settings(10.0 * tolerance));
 
     // Expectations:
     // 115058672785641.031
@@ -128,7 +142,7 @@ void test_many_points_per_circle()
             "mysql_report_2015_02_25_1",
             mysql_report_2015_02_25_1, join, end_flat,
             distance_strategy(6051788), side_strategy, point_circle(83585),
-            115058672785660, 25.0 * tolerance_multiplier);
+            115058672785660.0, ut_settings(25.0 * tolerance));
 
     // Takes about 7 seconds in release mode
     // Expectations:
@@ -139,7 +153,7 @@ void test_many_points_per_circle()
             "mysql_report_2015_02_25_1_250k",
             mysql_report_2015_02_25_1, join, end_flat,
             distance_strategy(6051788), side_strategy, point_circle(250000),
-            115058672879977, 75.0 * tolerance_multiplier);
+            115058672879977.0, ut_settings(75.0 * tolerance));
 
 #if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_SLOW_TESTS)
     // Takes about 110 seconds in release mode
@@ -147,7 +161,7 @@ void test_many_points_per_circle()
             "mysql_report_2015_02_25_1_800k",
             mysql_report_2015_02_25_1, join, end_flat,
             distance_strategy(6051788), side_strategy, point_circle(800000),
-            115058672871849.219, tolerance);
+            115058672871849.219, ut_settings(tolerance));
 #endif
 
     // 5666962: area ~> 100890546298964
@@ -159,7 +173,7 @@ void test_many_points_per_circle()
             "mysql_report_2015_02_25_2",
             mysql_report_2015_02_25_2, join, end_flat,
             distance_strategy(5666962), side_strategy, point_circle(46641),
-            100891031341795, 3.0 * tolerance_multiplier);
+            100891031341795.0, ut_settings(3.0 * tolerance));
 
     // Multipoint b with large distances/many points
     // Area ~> pi * 10x
@@ -173,7 +187,7 @@ void test_many_points_per_circle()
             "multipoint_b_50k",
             multipoint_b, join, end_flat,
             distance_strategy(1000000), side_strategy, point_circle(50000),
-            3141871558227, 10.0 * tolerance_multiplier);
+            3141871558227.0, ut_settings(10.0 * tolerance));
 
 #if defined(BOOST_GEOMETRY_BUFFER_INCLUDE_SLOW_TESTS)
     // Tests optimization min/max radius
@@ -182,7 +196,7 @@ void test_many_points_per_circle()
             "multipoint_b_500k",
             multipoint_b, join, end_flat,
             distance_strategy(10000000), side_strategy, point_circle(500000),
-            314162054419515.562, tolerance);
+            314162054419515.562, ut_settings((tolerance));
 #endif
 }