-
-
Notifications
You must be signed in to change notification settings - Fork 614
Fixed issue in CRT_vectors where moduli are not allowed to be coprime. #40007
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
Fixed issue in CRT_vectors where moduli are not allowed to be coprime. #40007
Conversation
@DaveWitteMorris. I have completed the expansion for |
@user202729. Sorry to mention you but it seems like an additional bug detailed Here might also be resolved by this PR. I just wanted to ask if you can confirm that this bug is related and solved by this PR? If it is I will add a Fixes thing at the top. |
It (probably?) only fix the second bug (moduli must be coprime), not the first, so I wouldn't count. |
Documentation preview for this PR (built with commit 4c17ea3; changes) is ready! 🎉 |
The code in lines 3695-3701 is an exact copy of the code in lines 3686-3692. You should refactor to eliminate this code duplication. One possibility might be something like:
|
Co-authored-by: DaveWitteMorris <[email protected]>
@DaveWitteMorris I have applied your suggestions and removed the code duplication. |
Before the construction of the CRT basis for non-coprime moduli (starting at line 3708), I think you need to add a comment something like:
|
Co-authored-by: DaveWitteMorris <[email protected]>
…t to make sure it works in every case.
Running doctests locally was successful, so I expect to set to positive review after the documentation typo is fixed. |
Co-authored-by: DaveWitteMorris <[email protected]>
@DaveWitteMorris. I've accepted the typo change. Thank you for pointing that out! Everything should be good for a positive review now. |
sagemathgh-40007: Fixed issue in CRT_vectors where moduli are not allowed to be coprime. Fixes sagemath#39158. Fixed the issue by creating functionality for `CRT_basis` if the moduli are not coprime. A more in depth explanation on how `CRT_basis` was expanded can be found in [Here](sagemath#39158). ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [X] The title is concise and informative. - [X] The description explains in detail what this PR is about. - [X] I have linked a relevant issue or discussion. - [X] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - sagemath#12345: short description why this is a dependency --> <!-- - sagemath#34567: ... --> URL: sagemath#40007 Reported by: Noel-Roemmele Reviewer(s): DaveWitteMorris, Noel-Roemmele
Fixes #39158. Fixed the issue by creating functionality for
CRT_basis
if the moduli are not coprime. A more in depth explanation on howCRT_basis
was expanded can be found in Here.📝 Checklist
⌛ Dependencies