Skip to content

Commit 120d496

Browse files
authored
fix normest not working on rectangular matrices (#364)
Closes #362
1 parent 5e2574d commit 120d496

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/utilities.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function normest(S, tol = -1, maxiter = 100)
3636

3737
x ./= e
3838
e_0 = zero(e)
39-
Sx = zeros(eltype(S), n)
39+
Sx = zeros(eltype(S), m)
4040

4141
while abs(e - e_0) > tol * e
4242
e_0 = e

test/test_normest.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ function simple_matrix_test_helper(S, ϵ_norm, ϵ)
1717
end
1818

1919
function simple_matrix_test(ϵ)
20-
(nrow, ncol) = (10, 10)
21-
for (nrow, ncol) in [(10, 10), (5, 5), (3, 3)]
20+
for (nrow, ncol) in [(10, 10), (5, 5), (3, 3), (3, 5), (5, 3), (5, 10), (10, 5)]
2221
ϵ_norm = eps(Float64)
2322
A1 = simple_matrix(ComplexF64, nrow, ncol)
2423
simple_matrix_test_helper(A1, ϵ_norm, ϵ)

0 commit comments

Comments
 (0)