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

add some triangular ring solver and asymptotically fast generics #1490

Merged
merged 7 commits into from
Dec 1, 2023

Conversation

fieker
Copy link
Contributor

@fieker fieker commented Nov 3, 2023

but what do we want?
we have
solve_triu for fields Ax = b
rings (this PR) Ax = b
solve_triu_left rings (this PR) xA = b
All three accept large "b", ie. can solve multiple equations in one.
However, they require "A" to be non-singular square

We also have
can_solve_left_reduced_triu
which can deal with arbitrary matrices "A" in rref, but can only deal with single row "b"

solve_triu for fields also has flags for the diagonal being 1

if b and A are square, this is asymptotically not optimal as it will be a n^3/2 algo

I can add test - if we want this "interface"

Note: for triangular, one cannot transpose to reduce one case to the
other
Note: in serious use, should also be supplemented by special
implementations in Nemo/ Flint for nmod and/or ZZ
and friends

Copy link

codecov bot commented Nov 3, 2023

Codecov Report

Attention: 86 lines in your changes are missing coverage. Please review.

Comparison is base (7f1b2f2) 87.11% compared to head (1d6093b) 86.95%.
Report is 2 commits behind head on master.

Files Patch % Lines
src/Matrix.jl 20.31% 51 Missing ⚠️
src/Matrix-Strassen.jl 79.28% 35 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1490      +/-   ##
==========================================
- Coverage   87.11%   86.95%   -0.17%     
==========================================
  Files         112      113       +1     
  Lines       28786    29023     +237     
==========================================
+ Hits        25078    25236     +158     
- Misses       3708     3787      +79     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

but what do we want?
we have
 solve_triu       for fields            Ax = b
                      rings (this PR)   Ax = b
 solve_triu_left      rings (this PR)   xA = b
All three accept large "b", ie. can solve multiple equations in one.
However, they require "A" to be non-singular square

We also have
 can_solve_left_reduced_triu
which can deal with arbitrary matrices "A" in rref, but can only
deal with single row "b"

solve_triu for fields also has flags for the diagonal being 1

if b and A are square, this is asymptotically not optimal as it will
be a n^3/2 algo

I can add test - if we want this "interface"

Note: for triangular, one cannot transpose to reduce one case to the
      other
Note: in serious use, should also be supplemented by special
      implementations in Nemo/ Flint for nmod and/or ZZ
      and friends
@fieker fieker changed the title add some triangular ring solver add some triangular ring solver and asymptotically fast generics Dec 1, 2023
@fieker
Copy link
Contributor Author

fieker commented Dec 1, 2023

also added module Strassen (see help string) to provide sub-cubic generics


#Examples:

```jldoctest
Copy link
Member

Choose a reason for hiding this comment

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

It seems that the doctest is failing

@thofma
Copy link
Member

thofma commented Dec 1, 2023

We should write down what we want for the "solve" interface or the linear algebra interface at large. I suggest we get the stuff here in, once the doctest is fixed.

@fieker fieker merged commit 5c4bd5c into master Dec 1, 2023
13 of 15 checks passed
@fieker fieker deleted the solve_triu branch December 1, 2023 16:42
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.

2 participants