-
Notifications
You must be signed in to change notification settings - Fork 10
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 * for more matrices defined from layouts #241
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should forward to
*(A::Diagonal, B.data::LayoutMatrix)
, so do we need to specialize the method for the triangular wrapper? Or will specializing it forLayoutMatrix
suffice?*(::Diagonal, ::LayoutMatrix)
method already exists, which should also make this work?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to all four of those methods? I think actually the second and fourth methods in your highlight aren't needed, so I could remove those. Otherwise I'm not sure what you mean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, they are all needed due to ambiguities that these fixes have to introduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm referring to the
*(A::Diagonal{<:Any,<:LayoutVector}, B::UpperOrLowerTriangular{<:Any,<:LayoutMatrix})
method on line 383, and the other order. Does this lead to ambiguities? If it does, I think this should be resolved inLinearAlgebra
as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the complete error from the ambiguity that made me add that line (the other direction doesn't have an ambiguity)
I could make the method be
Union{UnitUpperTriangular, UnitLowerTriangular}
instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually nevermind, that just adds another ambiguity that forces me to add the more general line.. now I remember.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide a MWE? How are
InfUnitUpperTriangular
andInfDiagonal
defined? Ideally,LinearAlgebra
should not be introducing these ambiguities, but we may have to add these methods for now, and version-limit these later.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are defined in this PR, built from my
InfVec
andInfMat
definitions. Without this PR, you can reproduce it using this MWE:julia> D * A ERROR: MethodError: *(::Diagonal{Float64, MyVec}, ::UnitUpperTriangular{Float64, MyMat}) is ambiguous. Candidates: *(D::Diagonal, A::UnitUpperTriangular) @ LinearAlgebra C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\diagonal.jl:578 *(A::Diagonal{<:Any, <:LayoutVector}, B::AbstractMatrix) @ ArrayLayouts C:\Users\djv23\.julia\packages\ArrayLayouts\VzDAX\src\ArrayLayouts.jl:220 *(D::Diagonal, A::LinearAlgebra.AbstractTriangular) @ LinearAlgebra C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\diagonal.jl:835 *(A::AbstractMatrix, B::LinearAlgebra.AbstractTriangular) @ LinearAlgebra C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\triangular.jl:1500 *(D::Diagonal, A::AbstractMatrix) @ LinearAlgebra C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\diagonal.jl:292 Possible fix, define *(::Diagonal{T, <:LayoutVector{T}} where T, ::UnitUpperTriangular) Stacktrace: [1] top-level scope @ Untitled-1:14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything else you want for this to be merged @jishnub? I'm not sure what would be defined on LinearAlgebra.jl's side but I think this would be good to go for now.