Skip to content

Commit

Permalink
Fix guide area in irregular branching scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
fontanf committed Sep 25, 2024
1 parent 10212ff commit 858a0f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/irregular/branching_scheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ BranchingScheme::Node BranchingScheme::child_tmp(
//std::cout << "* " << trapezoid.area() << " " << trapezoid.area(0.0) << std::endl;
//std::cout << "current_area: " << node.current_area << std::endl;
if (trapezoid.x_max() > node.xs_max)
node.guide_area += trapezoid.area(node.xs_max);
node.guide_area += (std::min)(trapezoid.area(), trapezoid.area(node.xs_max));
}
// Add area from extra rectangles.
for (const UncoveredTrapezoid& extra_trapezoid: node.extra_trapezoids) {
Expand All @@ -1405,7 +1405,7 @@ BranchingScheme::Node BranchingScheme::child_tmp(
//std::cout << trapezoid << std::endl;
//std::cout << "current_area " << node.current_area << std::endl;
if (trapezoid.x_max() > node.xs_max)
node.guide_area += trapezoid.area(node.xs_max);
node.guide_area += (std::min)(trapezoid.area(), trapezoid.area(node.xs_max));
}

// Compute node.xe_max and node.ye_max.
Expand Down Expand Up @@ -1525,7 +1525,7 @@ void BranchingScheme::insertions(
// << std::endl;
//for (const UncoveredTrapezoid& uncovered_trapezoid: parent->uncovered_trapezoids)
// std::cout << "* " << uncovered_trapezoid << std::endl;
//to_svg(parent, "node_" + std::to_string(parent->id) + ".svg");
//write_svg(parent, "node_" + std::to_string(parent->id) + ".svg");

// Add all previous insertions which are still valid.
if (parent->parent != nullptr) {
Expand Down

0 comments on commit 858a0f3

Please sign in to comment.