mirror of https://github.com/YosysHQ/abc.git
Adding sorting of columns in heuristic covering
This commit is contained in:
parent
1ca7a3a353
commit
3d602e2f00
|
|
@ -997,7 +997,7 @@ private:
|
||||||
best_bound_sets.clear();
|
best_bound_sets.clear();
|
||||||
|
|
||||||
/* create covering matrix */
|
/* create covering matrix */
|
||||||
if ( !create_covering_matrix<true>( isets, matrix, free_set_size, false ) )
|
if ( !create_covering_matrix<true>( isets, matrix, free_set_size, true ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1148,29 +1148,24 @@ private:
|
||||||
sol_existance |= column;
|
sol_existance |= column;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* necessary condition for the existance of a solution */
|
|
||||||
// if ( __builtin_popcountl( sol_existance ) != combinations )
|
|
||||||
// {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if ( !sort )
|
if ( !sort )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::sort( matrix.begin(), matrix.end(), [&]( auto const& a, auto const& b ) {
|
if constexpr ( UseHeuristic )
|
||||||
return a.sort_cost < b.sort_cost;
|
{
|
||||||
} );
|
std::sort( matrix.begin(), matrix.end(), [&]( auto const& a, auto const& b ) {
|
||||||
|
return a.cost < b.cost;
|
||||||
/* print */
|
} );
|
||||||
// if ( best_multiplicity < 6 )
|
return true;
|
||||||
// {
|
}
|
||||||
// for ( uint32_t i = 0; i < columns.size(); ++i )
|
else
|
||||||
// {
|
{
|
||||||
// std::cout << indexes[i] << " " << costs[i] << " \t" << columns[i] << "\n";
|
std::sort( matrix.begin(), matrix.end(), [&]( auto const& a, auto const& b ) {
|
||||||
// }
|
return a.sort_cost < b.sort_cost;
|
||||||
// }
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue