-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
The dispatch.jl file is only 47% tested: https://app.codecov.io/gh/jump-dev/MutableArithmetics.jl/blob/master/src/dispatch.jl
We should go through, remove the old hacks
MutableArithmetics.jl/src/dispatch.jl
Lines 751 to 777 in b46f175
| # Needed for Julia v1.1 only. If `parent(A)` is for instance `Diagonal`, the | |
| # `eltype` of `B` might be different form the `eltype` of `A`. | |
| function Matrix(A::LinearAlgebra.Symmetric{<:AbstractMutable}) | |
| B = LinearAlgebra.copytri!(convert(Matrix, copy(A.data)), A.uplo) | |
| for i in 1:size(A, 1) | |
| # `B[i, i]` is used instead of `A[i, i]` on Julia v1.1 hence the need | |
| # to overwrite it for `AbstractMutable`. | |
| B[i, i] = LinearAlgebra.symmetric( | |
| A[i, i], | |
| LinearAlgebra.sym_uplo(A.uplo), | |
| )::LinearAlgebra.symmetric_type(eltype(A.data)) | |
| end | |
| return B | |
| end | |
| function Matrix(A::LinearAlgebra.Hermitian{<:AbstractMutable}) | |
| B = LinearAlgebra.copytri!(convert(Matrix, copy(A.data)), A.uplo, true) | |
| for i in 1:size(A, 1) | |
| # `B[i, i]` is used instead of `A[i, i]` on Julia v1.1 hence the need | |
| # to overwrite it for `AbstractMutable`. | |
| B[i, i] = LinearAlgebra.hermitian( | |
| A[i, i], | |
| LinearAlgebra.sym_uplo(A.uplo), | |
| )::LinearAlgebra.hermitian_type(eltype(A.data)) | |
| end | |
| return B | |
| end |
and add tests.
Once upon a time, I tried this #78.
My mistake was that I tried too much in one go and I got bogged down.
Metadata
Metadata
Assignees
Labels
No labels