Refactor#26
Merged
Merged
Conversation
sukeya
marked this pull request as ready for review
May 17, 2026 22:54
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.
Overview
This PR refactors the
MVPolynomialimplementation and public API to make its internal invariants easier to preserve. In particular, it makes zero-coefficient handling and the representation of the zero polynomial consistent, so operations such as arithmetic, evaluation, integration, and composition behave more predictably.Previously,
MVPolynomialexposed a relatively map-like interface, which left more room for callers to break canonical zero-polynomial form or bypass index validation. This PR moves more of that responsibility into the class itself, clarifies the intended usage, and also revisits evaluation logic and allocator propagation.Main changes
MVPolynomialAPI is streamlined aroundget,try_get, andsetinstead of exposing a broader set of direct map-style mutations.operator()(coord_type)and polynomial compositionoperator()(MVPolynomial, axis)are cleaned up, and allocator propagation is preserved for internal temporary storage.clang-format, pre-commit, and workflow settings are updated to keep formatting and validation aligned in development.