Skip to content

Commit

Permalink
Apply Diagonal constructor to matrix directly
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Karrasch <daniel.karrasch@posteo.de>
  • Loading branch information
jishnub and dkarrasch authored Nov 8, 2024
1 parent e619454 commit 5363412
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/LinearAlgebra/src/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ cbrt(A::AdjointAbsMat) = adjoint(cbrt(parent(A)))
cbrt(A::TransposeAbsMat) = transpose(cbrt(parent(A)))

function applydiagonal(f, A)
dinv = f(Diagonal(diag(A)))
dinv = f(Diagonal(A))
copyto!(similar(A, eltype(dinv)), dinv)
end

Expand Down

0 comments on commit 5363412

Please sign in to comment.