Skip to content

Packed basis matrices in LLL - #2827

Merged
fredrik-johansson merged 2 commits into
flintlib:mainfrom
fredrik-johansson:gram
Sep 6, 2026
Merged

Packed basis matrices in LLL#2827
fredrik-johansson merged 2 commits into
flintlib:mainfrom
fredrik-johansson:gram

Conversation

@fredrik-johansson

Copy link
Copy Markdown
Collaborator

Allow fmpz_lll to use packed mpn representation of basis matrices instead of fmpz. Fixes #2389. For the multiprecision approximate LLL, few-limb dot products in the Gram basis are moreover done exactly via the dot product kernels introduced in #2824.

This turned out to have a bigger impact than I anticipated; factoring S10 got 1.7x faster. Improved timings on the hard polynomials in build/fmpz_poly_factor/profile/p-factor_hard -hard (the easier polynomials are unaffected):

                  old       new    speedup
H1              1.047     0.744     1.41x
S7              0.019     0.018     1.06x
S8              0.187     0.162     1.15x
C1              0.081     0.076     1.07x
S9              1.875     1.425     1.32x
H2              0.342     0.330     1.04x
P7*M12_5       27.568    21.049     1.31x
P7*M12_6       48.307    34.689     1.39x
S10            65.694    38.124     1.72x

Implemented using Claude Fable 5.1.

Also fixes a bug in fmpz_lll_heuristic_dot (apparently was harmless, but a bug nonetheless).

@fredrik-johansson
fredrik-johansson merged commit ba66071 into flintlib:main Sep 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integer packing in fmpz_lll

1 participant