Skip to content

Conversation

@ArunS-tack
Copy link
Contributor

@ArunS-tack ArunS-tack commented May 25, 2021

Closes JuliaLang/LinearAlgebra.jl#849.

Before
julia> rdiv!(ones(2,2), 3I(2)) ERROR: MethodError: no method matching rdiv!(::Matrix{Float64}, ::Diagonal{Int64, Vector{Int64}})

After
julia> rdiv!(ones(2,2), 3I(2)) 2×2 Matrix{Float64}: 0.333333 0.333333 0.333333 0.333333

@dkarrasch dkarrasch changed the title updating diagonal.jl wref #40887 Relax eltype condition in rdiv! with Diagonal May 28, 2021
@dkarrasch dkarrasch added the linear algebra Linear algebra label May 28, 2021
@dkarrasch
Copy link
Member

Maybe this is an opportunity to remove even more of the same-eltype conditions related to Diagonals? The same pattern can be seen in a few ldiv! and rdiv! methods below and above the current changes. I think it's safe to remove them. The functions will complain anyway if the target eltype cannot store the result type of the division.

@ArunS-tack
Copy link
Contributor Author

I deleted the main repository for this PR since you had reviewed and approved the changes (mainly because it was made from master and not a sub-branch). I can open another PR to implement what you suggested.

@dkarrasch
Copy link
Member

I deleted the main repository for this PR since you had reviewed and approved the changes (mainly because it was made from master and not a sub-branch). I can open another PR to implement what you suggested.

Sounds good.

@dkarrasch dkarrasch merged commit 14f2b73 into JuliaLang:master May 30, 2021
shirodkara pushed a commit to shirodkara/julia that referenced this pull request Jun 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linear algebra Linear algebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rdiv!(randn(4,4), I(4)) fails

3 participants