Skip to content

Commit eb97fcc

Browse files
mild refactoring
1 parent 0e881e7 commit eb97fcc

File tree

3 files changed

+40
-18
lines changed

3 files changed

+40
-18
lines changed

genaisrc/genaiscript.d.ts

Lines changed: 29 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/algebraic.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ Module Name:
2525
static void display_anums(std::ostream & out, scoped_anum_vector const & rs) {
2626
out << "numbers in decimal:\n";
2727
algebraic_numbers::manager & m = rs.m();
28-
for (unsigned i = 0; i < rs.size(); i++) {
29-
m.display_decimal(out, rs[i], 10);
28+
for (const auto& r : rs) {
29+
m.display_decimal(out, r, 10);
3030
out << "\n";
3131
}
3232
out << "numbers as root objects\n";
33-
for (unsigned i = 0; i < rs.size(); i++) {
34-
m.display_root(out, rs[i]);
33+
for (const auto& r : rs) {
34+
m.display_root(out, r);
3535
out << "\n";
3636
}
3737
out << "numbers as intervals\n";
38-
for (unsigned i = 0; i < rs.size(); i++) {
39-
m.display_interval(out, rs[i]);
38+
for (const auto& r : rs) {
39+
m.display_interval(out, r);
4040
out << "\n";
4141
}
4242
}

src/test/lp/gomory_test.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ struct gomory_test {
158158
TRACE("gomory_cut_detail", tout << "pol.size() > 1" << std::endl;);
159159
lcm_den = lcm(lcm_den, denominator(k));
160160
TRACE("gomory_cut_detail", tout << "k: " << k << " lcm_den: " << lcm_den << "\n";
161-
for (unsigned i = 0; i < pol.size(); i++) {
162-
tout << pol[i].first << " " << pol[i].second << "\n";
161+
for (const auto& p : pol) {
162+
tout << p.first << " " << p.second << "\n";
163163
}
164164
tout << "k: " << k << "\n";);
165165
lp_assert(lcm_den.is_pos());
@@ -172,8 +172,8 @@ struct gomory_test {
172172
k *= lcm_den;
173173
}
174174
TRACE("gomory_cut_detail", tout << "after *lcm\n";
175-
for (unsigned i = 0; i < pol.size(); i++) {
176-
tout << pol[i].first << " * v" << pol[i].second << "\n";
175+
for (const auto& p : pol) {
176+
tout << p.first << " * v" << p.second << "\n";
177177
}
178178
tout << "k: " << k << "\n";);
179179

@@ -210,7 +210,7 @@ struct gomory_test {
210210
bool some_int_columns = false;
211211
mpq f_0 = fractional_part(get_value(inf_col));
212212
mpq one_min_f_0 = 1 - f_0;
213-
for ( auto pp : row) {
213+
for (const auto& pp : row) {
214214
a = pp.first;
215215
x_j = pp.second;
216216
if (x_j == inf_col)

0 commit comments

Comments
 (0)