Skip to content

Commit

Permalink
fm: worst
Browse files Browse the repository at this point in the history
  • Loading branch information
hhirtz committed Apr 15, 2022
1 parent e447fca commit 21b0524
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/algorithms/fiduccia_mattheyses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ fn fiduccia_mattheyses<W>(
// number of vertices in the mesh. However, if too many subsequent
// bad flips are performed, the loop will break early
for _ in 0..max_moves_per_pass {
let (moved_vertex, move_gain) = match gain_to_vertex
let (moved_vertex, move_gain) = match gain_to_vertex[gain_table_idx(1)..]
.iter()
.rev()
.zip((-max_possible_gain..=max_possible_gain).rev())
.chain(gain_to_vertex[..gain_table_idx(1)].iter().rev())
.zip((1..=max_possible_gain).chain((-max_possible_gain..1).rev()))
.find_map(|(vertices, gain)| {
let (best_vertex, _) = vertices
.iter()
Expand Down

0 comments on commit 21b0524

Please sign in to comment.