-
Notifications
You must be signed in to change notification settings - Fork 38
Use LazyArrays to simplify linear algebra #67
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
Conversation
It requires LazyArrays.jl master for now. |
Turns out there is partial support for triangular banded through BLAS (rather than LAPACK): actually, I'm using this function This feels like a rather major change. Are other matrix packages moving away from overriding |
What other packages support views conforming to the same interface? The change is also motivated by the PR JuliaLang/julia#25558 which was close to being merged into Base, but then I decided a lazy Note that anything |
In some instances, the view of a low rank matrix, or a Toeplitz matrix could also support the same interface. I don't think those packages have interfaces at this point if that's what you're asking. |
The nice thing about avoiding Base is support for LazyArrays.jl can be added to existing matrix types without any changes to the package. So one could add support for T = Toeplitz(...)
V = view(T,1:5,1:5)
x .= Mul(V, y) without having to make any PR into ToeplitzMatrices.jl, and with no type piracy. |
Shouldn't |
Why? What benefit does it get from being in StdLib? By that logic, FillArrays should also not be used until it’s in Base. Shouldn’t BandedMatrix be in StdLib too before it’s used? The standard for getting code in Base/StdLib is higher than in user packages. It follows that this kind of change will be in packages before it is in StdLib, not the other way around. |
I get experimenting before contributing to stdlib, but why have a stdlib that's too burdensome to use? ( |
Because we couldn’t agree to what In the meantime, this gives me the functionality I need while also serving as a proof of concept. Also, this is all hidden from users, and is no more bizarre than what was already there. Also, I need LazyArrays to support the syntax |
Codecov Report
@@ Coverage Diff @@
## master #67 +/- ##
=========================================
Coverage ? 93.26%
=========================================
Files ? 16
Lines ? 594
Branches ? 0
=========================================
Hits ? 554
Misses ? 40
Partials ? 0
Continue to review full report at Codecov.
|
This PR does the following:
gbmv!
call:MemoryLayout
to return anAbstractBandedLayout
, and only supports LazyArrays.jl syntax for fast banded linear algebra:LinearAlgebra.mul!
andBase.*
will not automatically call banded routines. This is because they require too many ambiguity overrides, whereas LazyArrays.jl uses traits.gbmm!
for Banded * Banded. This is temporary: that needs to be rewritten to call BLAS Level 3 to get the desired speed.@MikaelSlevinsky If you have any comments Re our discussion. Once this is merged I'll add support triangular banded matrices. I will also remove
SymBandedMatrix
in favour ofSymmetric{BandedMatrix}
.@randy3k This is a substantial departure from the linear algebra code you wrote. I believe this is necessary to reduce code complexity and simplify use in BlockBandedMatrices.jl (where the blocks of
BandedBlockBandedMatrix
conform to the banded matrix interface). But any suggestions will be taken on board.