Skip to content

Commit

Permalink
Fix second leftover computation
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Jan 29, 2025
1 parent ab0ea30 commit 6d9de87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rectangleguillotine/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ void Solution::update_indicators(
// Update second_leftover_value_.
if (node.d == 1 && node.item_type_id != -3)
second_leftover_value_ = 0;
if (node.d == 2 && node.item_type_id == -1) {
if (node.d == 2 && node.item_type_id != -1)
second_leftover_value_ = 0;
if (node.d == 2 && node.item_type_id == -1)
second_leftover_value_ = (node.r - node.l) * (node.t - node.b);
}

// Check minimum waste length.
if (node.d >= 1
Expand Down

0 comments on commit 6d9de87

Please sign in to comment.