103SCENARIO(
"Simplicity tables match on-the-fly calculations for all 3D topologies",
"[simple][object][diamond][3D]" )
108 SECTION(
"26_6 topology using loadTable from string and default table size (2^26)"){
110 const auto & filename = simplicity::tableSimple26_6;
112 CHECK(ptable->size() == 67108864);
113 const auto & table = *ptable;
114 auto & objSet = obj.pointSet();
116 size_t nsimples_tables{0};
117 for(
const auto & p : objSet){
118 auto simple = obj.isSimple(p);
119 if( simple ) ++nsimples;
120 auto cfg = obj.getNeighborhoodConfigurationOccupancy(p, *mapZeroNeighborhoodToMask);
121 auto simple_from_table = table[cfg];
122 if( simple_from_table ) ++nsimples_tables;
123 INFO(
"Point: " << p <<
" cfg: " << cfg);
124 CHECK(simple == simple_from_table);
126 CHECK(nsimples == nsimples_tables);
127 auto border_size = obj.border().size();
128 CHECK(nsimples == border_size);
130 SECTION(
"18_6 topology using load table with explicit size (2^26)"){
132 const auto & filename = simplicity::tableSimple18_6;
134 auto ptable =
loadTable(filename, 67108864);
135 const auto & table = *ptable;
136 auto & objSet = obj.pointSet();
138 size_t nsimples_tables{0};
139 for(
const auto & p : objSet){
140 auto simple = obj.isSimple(p);
141 if( simple ) ++nsimples;
142 auto cfg = obj.getNeighborhoodConfigurationOccupancy(p, *mapZeroNeighborhoodToMask);
143 auto simple_from_table = table[cfg];
144 if( simple_from_table ) ++nsimples_tables;
145 INFO(
"Point: " << p <<
" cfg: " << cfg);
146 CHECK(simple == simple_from_table);
148 CHECK(nsimples == nsimples_tables);
149 auto border_size = obj.border().size();
150 CHECK(nsimples == border_size);
153 SECTION(
"6_26 topology using loadTable with template parameter N=3 (dimension)"){
155 const auto & filename = simplicity::tableSimple6_26;
157 const auto & table = *ptable;
158 auto & objSet = obj.pointSet();
160 size_t nsimples_tables{0};
161 for(
const auto & p : objSet){
162 auto simple = obj.isSimple(p);
163 if( simple ) ++nsimples;
164 auto cfg = obj.getNeighborhoodConfigurationOccupancy(p, *mapZeroNeighborhoodToMask);
165 auto simple_from_table = table[cfg];
166 if( simple_from_table ) ++nsimples_tables;
167 INFO(
"Point: " << p <<
" cfg: " << cfg);
168 CHECK(simple == simple_from_table);
170 CHECK(nsimples == nsimples_tables);
172 auto border_size = obj.border().size();
173 CHECK(nsimples != border_size);
178 const auto & filename = simplicity::tableSimple6_18;
180 const auto & table = *ptable;
181 auto & objSet = obj.pointSet();
183 size_t nsimples_tables{0};
184 for(
const auto & p : objSet){
185 auto simple = obj.isSimple(p);
186 if( simple ) ++nsimples;
187 auto cfg = obj.getNeighborhoodConfigurationOccupancy(p, *mapZeroNeighborhoodToMask);
188 auto simple_from_table = table[cfg];
189 if( simple_from_table ) ++nsimples_tables;
190 INFO(
"Point: " << p <<
" cfg: " << cfg);
191 CHECK(simple == simple_from_table);
193 CHECK(nsimples == nsimples_tables);
195 auto border_size = obj.border().size();
196 CHECK(nsimples != border_size);
251TEST_CASE_METHOD(Objects2D,
"Simplicity tables match on-the-fly calculations for all 2D topologies",
"[simple][object][balls][2D]" )
255 SECTION(
"8_4 and 4_8 topologies using loadTable with specific table size (2^8) and with template parameter N=2 (dimension)"){
258 const auto & filename = simplicity::tableSimple8_4;
260 const auto & table = *ptable;
262 auto & objSet = obj.pointSet();
264 size_t nsimples_tables{0};
265 for(
const auto & p : objSet){
266 auto simple = obj.isSimple(p);
267 if( simple ) ++nsimples;
268 auto cfg = obj.getNeighborhoodConfigurationOccupancy(p, *mapZeroNeighborhoodToMask);
269 auto simple_from_table = table[cfg];
270 if( simple_from_table ) ++nsimples_tables;
271 INFO(
"Point: " << p <<
" cfg: " << cfg);
272 CHECK(simple == simple_from_table);
274 CHECK(nsimples == nsimples_tables);
279 const auto & filename = simplicity::tableSimple4_8;
281 CHECK(ptable->size() == 256);
282 const auto & table = *ptable;
284 auto & objSet = obj.pointSet();
286 size_t nsimples_tables{0};
287 for(
const auto & p : objSet){
288 auto simple = obj.isSimple(p);
289 if( simple ) ++nsimples;
290 auto cfg = obj.getNeighborhoodConfigurationOccupancy(p, *mapZeroNeighborhoodToMask);
291 auto simple_from_table = table[cfg];
292 if( simple_from_table ) ++nsimples_tables;
293 INFO(
"Point: " << p <<
" cfg: " << cfg);
294 CHECK(simple == simple_from_table);
296 CHECK(nsimples == nsimples_tables);
303 const auto & filename = isthmusicity::tableIsthmus;
305 const auto & table = *ptable;
306 boost::ignore_unused_variable_warning(table);
309 const auto & filename = isthmusicity::tableOneIsthmus;
311 const auto & table = *ptable;
312 boost::ignore_unused_variable_warning(table);
315 const auto & filename = isthmusicity::tableTwoIsthmus;
317 const auto & table = *ptable;
318 boost::ignore_unused_variable_warning(table);
const ConstIterator & begin() const
const Point & lowerBound() const
const Point & upperBound() const
const ConstIterator & end() const