-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
LinearAlgebra traited matrix operations #48861
base: master
Are you sure you want to change the base?
Conversation
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.
Very interesting idea!
In your mind would GPUArrays define it's own StorageType? Or would it also re-use DenseStorage
?
The concrete subtypes shall always contain a field named `data` keeping the | ||
attributed object. | ||
""" | ||
abstract type AbstractStorageTrait{T} end |
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.
abstract type AbstractStorageTrait{T} end | |
abstract type AbstractStorageTrait{T} end | |
I am not fluent in It would define a trait A paradigmatic use is in JuliaSparse/SparseArrays.jl#354. |
This seems similar in some ways to https://github.com/JuliaLinearAlgebra/ArrayLayouts.jl. Do you envisage combining the two, such that the same traits may be used in both packages? |
There is the essential difference, that this PR tries to redirect the standard methods (All that can be managed inside |
The functions
*
,\
forAbstractMatrix
and[rl]mul!
and[rl]div!
for triangular matrices are equipped with an indirection trait, which allows to call specialized implementations, also if the type of the matrices is hidden for standard dispatch due to multiple wrappers.This is an effort to remedy the "Abstract Array Fallback Trap".
This PR does not introduce new behavior nor should it worsen runtime for the mentioned functions. But it allows other stdlibs or packages to use own implementations for selected subclasses of
AbstractMatrix
(for exampleSparseArrays
).