Use nmod_poly_minimal_irreducible for qadic context creation with small p#2582
Merged
fredrik-johansson merged 2 commits intoflintlib:mainfrom Feb 19, 2026
Conversation
…ll p When no Conway polynomial is available and the characteristic fits in a ulong, use nmod_poly_minimal_irreducible instead of the fmpz_mod_poly_randtest_sparse_irreducible. The former is a deterministic search with heavy pruning, improving creation time significantly.
Reorganized context init to have small p case first, moved variables declaration to happen in smaller scope, used fmpz_size + fmpz_get_ui instead of COEFF_IS_MPZ and accessing fmpz pointer, removed sys/types.h include (copy-paste from a different test)
Collaborator
|
Thanks! |
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.
When no Conway polynomial is available and the characteristic fits in a ulong, use nmod_poly_minimal_irreducible instead of the fmpz_mod_poly_randtest_sparse_irreducible. The former is a deterministic search with heavy pruning, improving creation time significantly.
The net result is, locally, from
to creating qadic contexts for [2, 3, 5, 7, 11]^[123, 628, 1024, 2048, 2755, 2867] in 15.9 seconds