-
Notifications
You must be signed in to change notification settings - Fork 38
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 multiplication for RectDiagonal #107
Comments
Currently, scalar multiplication of julia> 2Eye(10,10)
2Eye(10,10)
10×10 FillArrays.RectDiagonal{Float64, Vector{Float64}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}:
2.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ 2.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 2.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ 2.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 2.0 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ 2.0 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 2.0 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 2.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 2.0 ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 2.0 This can be easily fixed by adding the following two methods: Base.:*(a::FillArrays.RectDiagonal{<:Number, <:FillArrays.AbstractFill}, b::Number) = FillArrays.RectDiagonal(a.diag * b, a.axes)
Base.:*(a::Number, b::FillArrays.RectDiagonal{<:Number, <:FillArrays.AbstractFill}) = FillArrays.RectDiagonal(a * b.diag, b.axes) |
A PR would be greatly appreciated! |
I’m currently wrapping up some work on my side. Once I’ve finished, I’ll open a pull request as soon as possible. Thank you for your patience! :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is inconsistent:
The text was updated successfully, but these errors were encountered: