Skip to content

Commit fcbb11a

Browse files
return absolute value of eigenvalue for power_method
1 parent 3d987b5 commit fcbb11a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function power_method!(B::M, v₀::S, v₁::S, max_iter::Int = 1) where{M, S}
1212
normalize!(v₁)
1313
end
1414
mul!(v₁, B, v₀)
15-
return dot(v₀, v₁)
15+
return abs(dot(v₀, v₁))
1616
end
1717

1818
# use Arpack to obtain largest eigenvalue in magnitude with a minimum of robustness

0 commit comments

Comments
 (0)