Repository navigation
Conversation
The build treats warnings as errors and enables -Wfloat-equal, so the
`a.x() != b.x()` test in `operator<(Point, Point)` broke the build of
ad_physics ("comparing floating-point with '==' or '!=' is unsafe").
Order the points lexicographically using only `<`, which gives the same
result for all non-NaN coordinates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Summary
Fixes correctness/edge-case bugs and eliminates unnecessary allocations across
ad_physics(ad::geometry,ad::physics::RangeOperation, and Python bindings), with accompanying unit and Python interface regression tests.Bug Fixes
ad_physics/include/ad/physics/RangeOperation.hpp:isRangeSubRangeOf,doRangesOverlap,getIntersectionRange,subtractRangeFrom, andcombineRangesinstead of producing inverted range invariants or false positives.ad_physics/src/GeometryOperation.cpp&Types.hpp/GeometryOperation.hpp:combinePolygonBox,toPolygon,restrictHeadingRange, etc.) instead of out-of-bounds element access.PolygonVectorstream formatting separator logic.ad_physics/python/src/ChronoPythonWrapper.cpp&generate_python_lib.py.in:std::chronoBoost.Python converters; scope Python binding generation cleanly.Performance Improvements
Line2d,Polygon2d,MultiPolygon2d,PolygonVector) byconst &instead of by value and pre-reserve output vectors during conversion/combination.Tests
ad_physics/tests/GeometryOperationTest.cppandad_physics/tests/RangeOperationTests.cpp(registered inad_physics/tests/CMakeLists.txt) and Python tests inad_physics/python/tests/interface_test.py.This change is