Overhaul solving code for fmpz_mat and fmpq_mat - #2817
Merged
Conversation
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.
Near-completely rewrite of the fmpz_mat and fmpq_mat linear solving code, done using Claude Fable 5.
This is generally on par with the old code for small systems with small bit sizes while giving order-of-magnitude speedups in large dimensions and/or large bit sizes.
fmpq_mat_can_solve_multi_mod#2705 and generally improves performancefmpz_mat_is_singular(much faster than computing the rank or determinant) as a new function.fmpq_mat_can_solve_multi_mod#2705)Odds and ends:
Timings
n x n system; n x cols solution and right hand side
bits(A) = bits of the system matrix A
bits(B) = bits of the RHS
bits(X) = bits of solution numerator
bits(d) = bits of solution denominator
old
fmpz_mat_solvevs new, 1T = single thread; 8T = multithreadedn x 1, generic A and B:
n x n RHS, generic A and B:
n x 1, small determinant:
n x n, small determinant:
n x 1, generic A, generic X, B = A*X:
rank n / 2 (detecting singular system)
fmpz_mat_can_solve: A = 2k x k with rank k / 2, B = A * random (consistent)fmpz_mat_can_solve, A = 2k x k with rank k / 2, B = random (certifying inconsistent) system