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 763e7c6 commit 20b9efdCopy full SHA for 20b9efd
src/algorithms/fiduccia_mattheyses.rs
@@ -140,10 +140,10 @@ where
140
// number of vertices in the mesh. However, if too many subsequent
141
// bad flips are performed, the loop will break early
142
for move_num in 0..max_moves_per_pass {
143
- let (moved_vertex, move_gain) = match gain_to_vertex
+ let (moved_vertex, move_gain) = match gain_to_vertex[gain_table_idx(1)..]
144
.iter()
145
- .rev()
146
- .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()))
147
.find_map(|(vertices, gain)| {
148
let (best_vertex, _) = vertices
149
0 commit comments