3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-03 13:55:47 +00:00

test that pivoting is correct in dioph_eq.cpp

This commit is contained in:
Lev Nachmanson 2024-10-30 15:09:55 -07:00 committed by Lev Nachmanson
parent 0db0efce9f
commit 36293ac773
10 changed files with 399 additions and 223 deletions

View file

@ -90,8 +90,18 @@ std::ostream& print_linear_combination_customized(const vector<std::pair<T, unsi
out << "0";
return out;
}
// Copy term to a std_vector and sort by p.j()
std_vector<std::pair<T, unsigned>> sorted_coeffs;
sorted_coeffs.reserve(coeffs.size());
for (const auto& p : coeffs) {
sorted_coeffs.emplace_back(p.first, p.second);
}
std::sort(sorted_coeffs.begin(), sorted_coeffs.end(),
[](const auto& a, const auto& b) { return a.second < b.second; });
// Print the sorted term
bool first = true;
for (const auto & it : coeffs) {
for (const auto & it : sorted_coeffs) {
T val = it.first;
if (first) {
first = false;