Skip to content

Conversation

@Marvin-Beckmann
Copy link
Member

Description

To implement set_submatrix with the smallest possible overhead I have found a quite nice solution, but I need the ability to compare basetypes through a trait.
In that, I decided to model how we currently compare base errors (moduli errors) and made it its own trait.
We lose some precision in the comments, but the stacktrace also gives the information where the respective errors are from, and all the required debug information is still present.

This PR also improves code-maintainability and makes it easier to compare the base types going forward.

This PR implements...

  • the CompareBase trait for all matrices and additionally all base types, where a base comparison makes sense, i.e. PolyZq, PolynomialRingZq, Zq

Testing

  • I added basic working examples (possibly in doc-comment)
  • I triggered all possible errors in my test in every possible way
  • I included tests for all reasonable edge cases

Checklist:

  • I have performed a self-review of my own code
    • The code provides good readability and maintainability s.t. it fulfills best practices like talking code, modularity, ...
      • The chosen implementation is not more complex than it has to be
    • My code should work as intended and no side effects occur (e.g. memory leaks)
    • The doc comments fit our style guide
    • I have credited related sources if needed

@Marvin-Beckmann Marvin-Beckmann added the refactoring 🚜 Refactor code to improve consistancy label Apr 16, 2025
@Marvin-Beckmann Marvin-Beckmann self-assigned this Apr 16, 2025
@Marvin-Beckmann Marvin-Beckmann merged commit df602cd into dev Apr 16, 2025
3 checks passed
@Marvin-Beckmann Marvin-Beckmann deleted the rework_base_error_handling branch April 16, 2025 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring 🚜 Refactor code to improve consistancy

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants