Skip to content

Commit a66e165

Browse files
committed
Use permute to avoid double sorting
1 parent 9fd18b9 commit a66e165

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/implementations/eigh.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,10 @@ end
146146
function eigh_full!(A::Diagonal, DV, alg::DiagonalAlgorithm)
147147
check_input(eigh_full!, A, DV, alg)
148148
D, V = DV
149-
I = sortperm(diagview(A); by = real)
150149
diagA = diagview(A)
151150
I = sortperm(diagA; by = real)
152151
if D === A
153-
sort!(diagA)
152+
permute!(diagA, I)
154153
else
155154
diagview(D) .= real.(view(diagA, I))
156155
end

0 commit comments

Comments
 (0)