Skip to content

Commit 20b9efd

Browse files
committed
fm: worst
1 parent 763e7c6 commit 20b9efd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/algorithms/fiduccia_mattheyses.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ where
140140
// number of vertices in the mesh. However, if too many subsequent
141141
// bad flips are performed, the loop will break early
142142
for move_num in 0..max_moves_per_pass {
143-
let (moved_vertex, move_gain) = match gain_to_vertex
143+
let (moved_vertex, move_gain) = match gain_to_vertex[gain_table_idx(1)..]
144144
.iter()
145-
.rev()
146-
.zip((-max_possible_gain..=max_possible_gain).rev())
145+
.chain(gain_to_vertex[..gain_table_idx(1)].iter().rev())
146+
.zip((1..=max_possible_gain).chain((-max_possible_gain..1).rev()))
147147
.find_map(|(vertices, gain)| {
148148
let (best_vertex, _) = vertices
149149
.iter()

0 commit comments

Comments
 (0)