We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e447fca commit 21b0524Copy full SHA for 21b0524
src/algorithms/fiduccia_mattheyses.rs
@@ -122,10 +122,10 @@ fn fiduccia_mattheyses<W>(
122
// number of vertices in the mesh. However, if too many subsequent
123
// bad flips are performed, the loop will break early
124
for _ in 0..max_moves_per_pass {
125
- let (moved_vertex, move_gain) = match gain_to_vertex
+ let (moved_vertex, move_gain) = match gain_to_vertex[gain_table_idx(1)..]
126
.iter()
127
- .rev()
128
- .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()))
129
.find_map(|(vertices, gain)| {
130
let (best_vertex, _) = vertices
131
0 commit comments