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

check coprimality of moduli in CRT_basis() #36457

Merged

Conversation

yyyyx4
Copy link
Member

@yyyyx4 yyyyx4 commented Oct 12, 2023

The xgcd() calls used in this function to compute modular inverses already compute the greatest common divisor as a byproduct, so we might as well add the cheap .is_one() check. Benchmarking reveals no measurable timing difference between the two versions.

@yyyyx4 yyyyx4 force-pushed the public/check_coprimality_in_crt_basis branch from 67ef84e to 9a4a464 Compare November 15, 2023 10:25
@yyyyx4
Copy link
Member Author

yyyyx4 commented Nov 15, 2023

Thanks, done.

Copy link

Documentation preview for this PR (built with commit 9a4a464; changes) is ready! 🎉

Copy link
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM.

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 4, 2023
    
The `xgcd()` calls used in this function to compute modular inverses
already compute the greatest common divisor as a byproduct, so we might
as well add the cheap `.is_one()` check. Benchmarking reveals no
measurable timing difference between the two versions.
    
URL: sagemath#36457
Reported by: Lorenz Panny
Reviewer(s): Kwankyu Lee
@vbraun vbraun merged commit 8bcebb1 into sagemath:develop Dec 6, 2023
18 of 20 checks passed
@mkoeppe mkoeppe added this to the sage-10.3 milestone Dec 6, 2023
@yyyyx4 yyyyx4 deleted the public/check_coprimality_in_crt_basis branch December 6, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants