Only images remain with multiple types in a run of partners. Sets the type of all in the group to the maximum of the group.
| 1348 | // Only images remain with multiple types in a run of partners. |
| 1349 | // Sets the type of all in the group to the maximum of the group. |
| 1350 | void ColumnFinder::SmoothPartnerRuns() { |
| 1351 | // Iterate the ColPartitions in the grid. |
| 1352 | GridSearch<ColPartition, ColPartition_CLIST, ColPartition_C_IT> |
| 1353 | gsearch(&part_grid_); |
| 1354 | gsearch.StartFullSearch(); |
| 1355 | ColPartition* part; |
| 1356 | while ((part = gsearch.NextFullSearch()) != NULL) { |
| 1357 | ColPartition* partner = part->SingletonPartner(true); |
| 1358 | if (partner != NULL) { |
| 1359 | if (partner->SingletonPartner(false) != part) { |
| 1360 | tprintf("Ooops! Partition:(%d partners)", |
| 1361 | part->upper_partners()->length()); |
| 1362 | part->Print(); |
| 1363 | tprintf("has singleton partner:(%d partners", |
| 1364 | partner->lower_partners()->length()); |
| 1365 | partner->Print(); |
| 1366 | tprintf("but its singleton partner is:"); |
| 1367 | if (partner->SingletonPartner(false) == NULL) |
| 1368 | tprintf("NULL\n"); |
| 1369 | else |
| 1370 | partner->SingletonPartner(false)->Print(); |
| 1371 | } |
| 1372 | ASSERT_HOST(partner->SingletonPartner(false) == part); |
| 1373 | } else if (part->SingletonPartner(false) != NULL) { |
| 1374 | ColPartitionSet* column_set = best_columns_[gsearch.GridY()]; |
| 1375 | int column_count = column_set->ColumnCount(); |
| 1376 | part->SmoothPartnerRun(column_count * 2 + 1); |
| 1377 | } |
| 1378 | } |
| 1379 | } |
| 1380 | |
| 1381 | // Helper functions for TransformToBlocks. |
| 1382 | // Add the part to the temp list in the correct order. |
nothing calls this directly
no test coverage detected