Repository navigation
Document GeneralizedTrapezoid and remove its unused covered flags - #147
Merged
Merged
Conversation
The remaining methods of GeneralizedTrapezoid are documented: the moves, the slopes of the sides (the variation of x for a unit increase of y) and their directions, the partial area on the right of a vertical line, clean, which makes the almost vertical sides vertical so that the result contains the generalized trapezoid, operator==, the symmetries, to_shape and the JSON functions. The comment of width_top_ is fixed. The top and bottom covered flags were added to optimize the trapezoidal insertions of PackingSolver, but PackingSolver doesn't use them anymore since its irregular branching scheme was rewritten, and the library never used them. They are removed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
About 20 methods of
GeneralizedTrapezoid, written on a single line, had no documentation, and its top / bottom "covered" flags were used neither by the library nor by PackingSolver.Change
shift_top,shift_right,extend_left,a_left/a_right(variation of x for a unit increase of y: 0 for a vertical side, positive if the side goes to the right going up), the*_increasing/decreasing_not_verticaldirections,area(x_left)(area on the right of a vertical line),clean(sides whose slope is below 1e-2 or above 1e2 in absolute value are made vertical through their outermost corner, so that the result contains the trapezoid),operator==(y exact, x within tolerance), the symmetries,to_shapeand the JSON functions.width_top_, which said "Bottom height", is fixed.set_top_covered,set_bottom_covered,top_covered,bottom_coveredand their members are removed. They were added for the trapezoidal insertions of PackingSolver ("Implement trapezoidal insertions"), whose last uses were removed in "Re-write irregular branching scheme (#199)": neither PackingSolver'smasternor the library uses them.extend_leftis documented with its intended behaviour: it currently doesn't update the cached widths and area. This will be fixed in a separate PR.Tests
The slopes, their directions, both cases of
area(x_left)and the area ofto_shapewere checked by running them. The library builds and the full suite passes (693 tests).