Skip to content

Commit ab5fe98

Browse files
author
mohamed82008
committed
Make realdiag! work for non-square matrices
1 parent ed62012 commit ab5fe98

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)