53 std::vector<Point> Sites;
59 Sites.push_back( point );
62 std::cout << std::endl;
67 std::unordered_set<Point> voronoi_points;
68 double voronoi_distance =
69 std::numeric_limits<int>::max();
70 for (
Point site : Sites )
72 if ( ( point - site ).norm() < voronoi_distance )
74 voronoi_points.clear();
75 voronoi_points.insert( site );
76 voronoi_distance = ( point - site ).norm();
78 else if ( ( point - site ).norm() == voronoi_distance )
80 voronoi_points.insert( site );
83 voronoi_map->
setValue( point, voronoi_points );
96 Point lowerBound( 0, 0 ), upperBound( 31, 31 );
100 int point_setup_index = 0;
104 while ( point_setup_index < 400 )
123 "Testing that VoronoiMapComplete class gives the right voronoi sites sets" )
125 for (
Point point : set )
127 std::unordered_set<Point> brut_force_set =
128 brut_force_vmap->operator()( point );
133 for (
Point voronoi_point : brut_force_set )
135 REQUIRE( std::find( class_set.begin(), class_set.end(),
136 voronoi_point ) != class_set.end() );
141 for (
Point voronoi_point : class_set )
143 REQUIRE( std::find( brut_force_set.begin(), brut_force_set.end(),
144 voronoi_point ) != brut_force_set.end() );
150 "Testing Complete Voronoi Map from Discrete Bisector Function paper" )
152 Point _lowerBound( 0, 0 ), _upperBound( 6, 7 );
153 Domain _domain( _lowerBound, _upperBound );
157 if ( point !=
Point( 1, 0 ) && point !=
Point( 5, 0 ) &&
158 point !=
Point( 2, 2 ) && point !=
Point( 4, 4 ) &&
159 point !=
Point( 0, 6 ) && point !=
Point( 6, 6 ) &&
160 point !=
Point( 3, 7 ) )
168 for (
Point point : _set )
170 std::unordered_set<Point> brut_force_set =
171 brutForceVoronoiMap->operator()( point );
176 for (
Point voronoi_point : brut_force_set )
177 REQUIRE( std::find( class_set.begin(), class_set.end(),
178 voronoi_point ) != class_set.end() );
182 for (
Point voronoi_point : class_set )
183 REQUIRE( std::find( brut_force_set.begin(), brut_force_set.end(),
184 voronoi_point ) != brut_force_set.end() );