-
Notifications
You must be signed in to change notification settings - Fork 0
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
Some operations like inv
don't work on certain matrices
#5
Comments
I think its actually Actually does calling |
Unfortunately not.
Makes sense. I'll look into that in ILA.jl |
Also can't do
Doesn't seem to interact with ArrayLayouts.jl at all for these finite matrices. Have you had to get around this previously? I could try and define |
Need to overload |
So far I have (could maybe do it in a loop.. but having it written out probably helps for patching possible ambiguities later on?) *(A::SymTridiagonal{<:Any,<:LayoutVector}, B::SymTridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::SymTridiagonal{<:Any,<:LayoutVector}, B::Tridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::SymTridiagonal{<:Any,<:LayoutVector}, B::Bidiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::SymTridiagonal{<:Any,<:LayoutVector}, B::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}) = mul(A, B)
*(A::SymTridiagonal, B::Diagonal{<:Any,<:LayoutVector}) = mul(A, B) # ambiguity
*(A::Tridiagonal{<:Any,<:LayoutVector}, B::Tridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Tridiagonal{<:Any,<:LayoutVector}, B::SymTridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Tridiagonal{<:Any,<:LayoutVector}, B::Bidiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Tridiagonal{<:Any,<:LayoutVector}, B::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}) = mul(A, B)
*(A::Bidiagonal{<:Any,<:LayoutVector}, B::Bidiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Bidiagonal{<:Any,<:LayoutVector}, B::SymTridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Bidiagonal{<:Any,<:LayoutVector}, B::Tridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::Bidiagonal{<:Any,<:LayoutVector}, B::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}) = mul(A, B)
*(A::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}, B::SymTridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}, B::Tridiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}, B::Bidiagonal{<:Any,<:LayoutVector}) = mul(A, B)
*(A::UpperOrLowerTriangular{<:Any,<:LayoutMatrix}, B::Diagonal{<:Any,<:LayoutVector}) = mul(A, B) # ambiguity
*(A::Diagonal{<:Any, <:LayoutVector}, B::SymTridiagonal{<:Any, <:LayoutVector}) = mul(A, B)
*(A::Diagonal{<:Any, <:LayoutVector}, B::UpperOrLowerTriangular{<:Any, <:LayoutMatrix}) = mul(A, B) which fixes the Are there similar methods somewhere for fixing issues with which does something similar but maybe I've overlooked something simpler. |
Actually I guess that code I've linked is probably as simple as it'd get, so I'll just do that. Or I might just end up leaving it and go to fixing |
For reasons I can't explain There was a point in time when ArrayLayouts.jl was just part of LazyArrays.jl and That is to say: I'm not sure if there's a more systematic way to deal with |
Yeah, I gave up on the I got to work on inv(A::SymTridiagonal{<:Any, <:LayoutVector}) = inv_layout(MemoryLayout(A), axes(A), A)
inv(A::Tridiagonal{<:Any, <:LayoutVector}) = inv_layout(MemoryLayout(A), axes(A), A)
inv(A::Bidiagonal{<:Any, <:LayoutVector}) = inv_layout(MemoryLayout(A), axes(A), A)
# \(A::SymTridiagonal{<:Any, <:LayoutVector}, B::LayoutVector; kwds...) = ArrayLayouts.ldiv(A, B; kwds...) # ambiguity. (doesn't work) but stopped there since I'd need to do some patching in InfiniteLinearAlgebra.jl with this so that qr_layout(::SymTridiagonalLayout{<:AbstractLazyLayout, <:AbstractLazyLayout}, ::NTuple{2,OneToInf{Int}}, A) = adaptiveqr(A)
qr_layout(::TridiagonalLayout{<:AbstractLazyLayout, <:AbstractLazyLayout, <:AbstractLazyLayout}, ::NTuple{2,OneToInf{Int}}, A) = adaptiveqr(A)
qr_layout(::Bidiagonal{<:AbstractLazyLayout, <:AbstractLazyLayout}, ::NTuple{2,OneToInf{Int}}, A) = adaptiveqr(A) can be defined. Technically type piracy within InfiniteLinearAlgebra.jl but it's apparently fine since stuff like that's already done in that package. This needs even more patching though since |
There's not a good paradigm for type piracy where a downstream package implements functionality. I just ran into this with So: don't worry about it! |
That makes sense. I've started the |
These are downstream issues, but will get them here for now while I think about where the issues actually go.
The text was updated successfully, but these errors were encountered: