Skip to content

Fix bug in gr_mat_move_row#2511

Merged
fredrik-johansson merged 2 commits intoflintlib:mainfrom
fredrik-johansson:lll7
Dec 3, 2025
Merged

Fix bug in gr_mat_move_row#2511
fredrik-johansson merged 2 commits intoflintlib:mainfrom
fredrik-johansson:lll7

Conversation

@fredrik-johansson
Copy link
Copy Markdown
Collaborator

@fredrik-johansson fredrik-johansson commented Dec 1, 2025

Hopefully fixes #2510.

Also fixes fmpz_mat_is_reduced to not hang when checking the output. BTW, fmpz_mat_is_reduced returns false in flint-3.3 here, and I've made it return the same thing. Was this the intended behavior?

Unfortunately our test code for fmpz_lll seems to do a really poor job testing rank-deficient matrices.

…reduced, both affecting LLL for rank-deficient matrices
@thofma
Copy link
Copy Markdown
Contributor

thofma commented Dec 1, 2025

I think the original code was never intended for the rank-deficient case. See #1168.

Comment thread src/fmpz_mat/is_reduced.c
/* Failure with the fmpq context implied that we attempted to divide
by an exactly zero GS norm; by the current definition, this
matrix is not reduced. */
if (prec >= exact_cutoff)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This second if statement will never evaluate to true, as the condition is already checked in the previous one. Is this intended?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The statement was indeed duplicated; thanks for spotting.

@lgoettgens
Copy link
Copy Markdown
Contributor

I can verify that with this patch applied, the errors from thofma/Hecke.jl#2095 disappear.

@fredrik-johansson fredrik-johansson merged commit 32cf614 into flintlib:main Dec 3, 2025
12 checks passed
@fredrik-johansson fredrik-johansson deleted the lll7 branch December 3, 2025 21:29
@lgoettgens lgoettgens added the bug label Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GR_MUST_SUCCEED in fmpz_lll

3 participants