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

Improve algorithm selection in fmpz_mat_rref #2144

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/fmpz_mat/rref.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2011-2012 Fredrik Johansson
Copyright (C) 2011-2012, 2025 Fredrik Johansson
Copyright (C) 2014 Alex J. Best

This file is part of FLINT.
Expand All @@ -15,9 +15,10 @@
slong
fmpz_mat_rref(fmpz_mat_t R, fmpz_t den, const fmpz_mat_t A)
{
if (FLINT_MIN(A->c, A->r) <= 20)
return fmpz_mat_rref_fflu(R, den, A);
else if (A->r <= 105 && A->c >= 1.4 * A->r)
slong r = A->r;
slong c = A->c;

if (r <= 3 || c <= 2 || (r <= 20 && c > r) || (r > 20 && r <= 100 && c > r + (r - 20) / 80.0 * r))
return fmpz_mat_rref_fflu(R, den, A);
else
return fmpz_mat_rref_mul(R, den, A);
Expand Down