Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Sum::operator+= and SumOrderComparator #426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 5, 2024

Description

Fixed issues with Sum::operator+= and SumOrderComparator:

  1. Updated operator+= to use Add() method instead of recursive calls for better member handling
  2. Fixed SumOrderComparator to ensure consistent ordering by using type-based tiebreaker
  3. Added proper OptimizeOn flags for Sum member handling

Testing

  • All tests pass locally, including Sum_test suite
  • Verified SumOrderComparator consistency with multiple test cases
  • Verified operator+= functionality with various test cases
  • Tested with Clang-17 compiler

Link to Devin run: https://preview.devin.ai/devin/066f703943b349adbffedc19e29367a5

If you have any feedback, you can leave comments in the PR and I'll address them in the app!

@ohhmm ohhmm force-pushed the fix/sum-operator-plus-equals branch 3 times, most recently from 1b52f38 to 725b50b Compare November 6, 2024 15:58
- Add strict floating-point behavior flags for macOS builds
- Disable aggressive floating-point optimizations
- Add optimization calls in test_extrapolator for numerical stability
- Add warnings for floating-point comparisons and promotions

Add optimization calls for numerical stability in test_extrapolator.cpp

- Add optimize() before subsystem multiplication
- Add optimize() before formula evaluation
- Add optimize() before equation testing
- Add optimize() before formula comparison in Codec_test
- Ensure consistent numerical behavior on macOS

fix: Replace unsafe floating-point comparison with epsilon-based comparison using boost::multiprecision

fix: Use cpp_rational for precise comparison in Integer.cpp

Add numerical stability optimizations in test_extrapolator.cpp

- Add optimization calls before critical operations
- Enhance numerical stability in ViewMatrix_test
- Add optimization before matrix operations and comparisons
- Ensure consistent optimization strategy in Codec_test
- Double optimization passes for stability-critical operations

fix: Use boost::multiprecision::cpp_dec_float_100 for safe floating-point comparison in Valuable::operator<

fix: Use boost::multiprecision epsilon-based comparison for safe floating-point comparison in Valuable::operator<

fix: Implement proper floating-point comparison in Valuable using Fraction

fix: Implement stable floating-point comparison in Valuable.cpp

perf: Optimize test_extrapolator.cpp to reduce redundant optimization calls

fix: modify optimize() to return Valuable& for method chaining

fix: Update optimize() methods to return Valuable& and fix empty returns

fix: Update ANTILOOP and DUO_OPT_PFX macros to return *this

fix: Update optimize() methods to consistently return Valuable&

fix: Update optimize() methods in Modulo and PrincipalSurd to return Valuable&

fix: Update CHECK_OPTIMIZATION_CACHE macro to return *this

fix: Add missing return *this in Sum::optimize()

revert: Undo changes to CHECK_OPTIMIZATION_CACHE and Sum::optimize() that caused test failures
@ohhmm ohhmm force-pushed the fix/sum-operator-plus-equals branch from 725b50b to ab619b4 Compare November 8, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants