Skip to content

Commit c078e99

Browse files
mohamed82008haampie
authored andcommitted
Make realdiag! work for non-square matrices
1 parent dd1a918 commit c078e99

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lobpcg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ end
288288

289289
realdiag!(M) = nothing
290290
function realdiag!(M::AbstractMatrix{TC}) where TC <: Complex
291-
@inbounds for i in 1:size(M, 1)
291+
@inbounds for i in 1:minimum(size(M))
292292
M[i,i] = real(M[i,i])
293293
end
294294
return M

0 commit comments

Comments
 (0)