You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restrict Diagonal sqrt branch to positive diag (#1203)
As noted in #1193,
the `sqrt(::Digonal{<:Real})` method requires the diagonal element to be
positive, so that `sqrt` is defined for the individual elements. We
therefore may restrict the diagonal branch in the dense `sqrt` method to
matrices with positive `diag` if the `eltype` is `Real`.
Fixes#1193
After this,
```julia
julia> A = diagm(0 => [1.0, -1.0])
2×2 Matrix{Float64}:
1.0 0.0
0.0 -1.0
julia> sqrt(A)
2×2 Matrix{ComplexF64}:
1.0+0.0im 0.0+0.0im
0.0+0.0im 0.0+1.0im
```
(cherry picked from commit 16d9d61)
0 commit comments