From eb97fcc2737ca59f3238e9fb0bb71136e690fba1 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Sun, 16 Mar 2025 12:24:41 -0700 Subject: [PATCH] mild refactoring --- genaisrc/genaiscript.d.ts | Bin 135966 -> 136603 bytes src/test/algebraic.cpp | 12 ++++++------ src/test/lp/gomory_test.h | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/genaisrc/genaiscript.d.ts b/genaisrc/genaiscript.d.ts index 10b31f850e82027b00457ed0f406f4aa4e9f5462..ae37c093763adf970a598b87ed3ae0f6e086b463 100644 GIT binary patch delta 495 zcmbQYjAQm{jtLITrg{b&o!dCrlJoNmQi~=}8k!2Wc9Ru{YEdq(AW#*(>O@HseC?^L}pb$`$pPN~nYEzb< znPLalURau1RB5F!-Cu`MTen)FB)`Dh-bx{_G&d==$XX#cGcPzfzbF+hq)-di1-4DF zNlZ07vm^toB0AQNtCou^Gp{7IC@nELRUs@jxg@^`?9%Bs9T|0X%TkMqGxPJ{Mu81V zNzF+uN%c%~tpIwX7$}#NpP!SOm^V4$kkRB_vAomIIx@;|BbhaM<6Ozf7nX8No@>T6 zUD=7T2&8KJM<>Q|P9vZE#FS!%{33(?-8To V_B}3)<(!jq>bbXn@MBzk3;>t4EVlpv diff --git a/src/test/algebraic.cpp b/src/test/algebraic.cpp index 371997c02..8d1b60777 100644 --- a/src/test/algebraic.cpp +++ b/src/test/algebraic.cpp @@ -25,18 +25,18 @@ Notes: static void display_anums(std::ostream & out, scoped_anum_vector const & rs) { out << "numbers in decimal:\n"; algebraic_numbers::manager & m = rs.m(); - for (unsigned i = 0; i < rs.size(); i++) { - m.display_decimal(out, rs[i], 10); + for (const auto& r : rs) { + m.display_decimal(out, r, 10); out << "\n"; } out << "numbers as root objects\n"; - for (unsigned i = 0; i < rs.size(); i++) { - m.display_root(out, rs[i]); + for (const auto& r : rs) { + m.display_root(out, r); out << "\n"; } out << "numbers as intervals\n"; - for (unsigned i = 0; i < rs.size(); i++) { - m.display_interval(out, rs[i]); + for (const auto& r : rs) { + m.display_interval(out, r); out << "\n"; } } diff --git a/src/test/lp/gomory_test.h b/src/test/lp/gomory_test.h index 9ac675d1a..f7f822566 100644 --- a/src/test/lp/gomory_test.h +++ b/src/test/lp/gomory_test.h @@ -158,8 +158,8 @@ struct gomory_test { TRACE("gomory_cut_detail", tout << "pol.size() > 1" << std::endl;); lcm_den = lcm(lcm_den, denominator(k)); TRACE("gomory_cut_detail", tout << "k: " << k << " lcm_den: " << lcm_den << "\n"; - for (unsigned i = 0; i < pol.size(); i++) { - tout << pol[i].first << " " << pol[i].second << "\n"; + for (const auto& p : pol) { + tout << p.first << " " << p.second << "\n"; } tout << "k: " << k << "\n";); lp_assert(lcm_den.is_pos()); @@ -172,8 +172,8 @@ struct gomory_test { k *= lcm_den; } TRACE("gomory_cut_detail", tout << "after *lcm\n"; - for (unsigned i = 0; i < pol.size(); i++) { - tout << pol[i].first << " * v" << pol[i].second << "\n"; + for (const auto& p : pol) { + tout << p.first << " * v" << p.second << "\n"; } tout << "k: " << k << "\n";); @@ -210,7 +210,7 @@ struct gomory_test { bool some_int_columns = false; mpq f_0 = fractional_part(get_value(inf_col)); mpq one_min_f_0 = 1 - f_0; - for ( auto pp : row) { + for (const auto& pp : row) { a = pp.first; x_j = pp.second; if (x_j == inf_col)