Skip to content

Commit d61792b

Browse files
committed
get two entry directly
1 parent c9cc49e commit d61792b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/sage/geometry/lattice_polytope.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,8 +3290,9 @@ def index_of_max(iterable):
32903290
# between 0 and S(0)
32913291
for s in range(l, n_f):
32923292
for j in range(1, S[0]):
3293-
v = tuple(PM[permutations_bar[n_p][0](s+1) - 1, permutations_bar[n_p][1](i+1) - 1] for i in range(n_v))
3294-
if v[0] < v[j]:
3293+
v0 = PM[permutations_bar[n_p][0](s+1) - 1, permutations_bar[n_p][1](1) - 1]
3294+
vj = PM[permutations_bar[n_p][0](s+1) - 1, permutations_bar[n_p][1](j+1) - 1]
3295+
if v0 < vj:
32953296
permutations_bar[n_p][1] = PGE(S_v, 1, j + 1) * permutations_bar[n_p][1]
32963297
if ccf == 0:
32973298
l_r[0] = PM[permutations_bar[n_p][0](s+1) - 1, permutations_bar[n_p][1](1) - 1]
@@ -3336,8 +3337,9 @@ def index_of_max(iterable):
33363337
s -= 1
33373338
# Find the largest value in this symmetry block
33383339
for j in range(c + 1, h):
3339-
v = tuple(PM[(permutations_bar[s][0])(l+1) - 1, (permutations_bar[s][1])(i+1) - 1] for i in range(n_v))
3340-
if (v[c] < v[j]):
3340+
vc = PM[(permutations_bar[s][0])(l+1) - 1, (permutations_bar[s][1])(c+1) - 1]
3341+
vj = PM[(permutations_bar[s][0])(l+1) - 1, (permutations_bar[s][1])(j+1) - 1]
3342+
if (vc < vj):
33413343
permutations_bar[s][1] = PGE(S_v, c + 1, j + 1) * permutations_bar[s][1]
33423344
if ccf == 0:
33433345
# Set reference and carry on to next permutation

0 commit comments

Comments
 (0)