diff --git a/src/skeweigen.jl b/src/skeweigen.jl index 57a7ca6..7b1e097 100644 --- a/src/skeweigen.jl +++ b/src/skeweigen.jl @@ -2,6 +2,7 @@ function getgivens(a,b) nm = hypot(a, b) + iszero(nm) && return one(typeof(a)), b return a / nm , b / nm end @@ -111,10 +112,9 @@ end max_iter = 30 * n iter = 0 ; N = n - while n > 2 && iter < max_iter implicitstep_novec(ev, n - 1) - while n > 2 && abs(ev[n - 2]) < tol * abs(ev[n - 1]) + while n > 2 && abs(ev[n - 2]) <= tol * abs(ev[n - 1]) eigofblock(ev[n - 1], values[n-1:n] ) n -= 2 end @@ -185,7 +185,7 @@ end while n > 2 && iter < max_iter implicitstep_vec!(ev, Qeven, Qodd, n - 1, halfN) - while n > 2 && abs(ev[n - 2]) < tol*abs(ev[n - 1]) + while n > 2 && abs(ev[n - 2]) <= tol*abs(ev[n - 1]) eigofblock(ev[n - 1], values[n-1:n]) n -= 2 end @@ -250,7 +250,7 @@ end halfN = div(n, 2) while n > 2 && iter < max_iter implicitstep_vec!(ev, Qeven, Qodd, n - 1, halfN) - while n > 2 && abs(ev[n - 2]) < tol*abs(ev[n - 1]) + while n > 2 && abs(ev[n - 2]) <= tol*abs(ev[n - 1]) eigofblock(ev[n - 1], values[n-1:n]) n -= 2 end diff --git a/src/tridiag.jl b/src/tridiag.jl index e2bbc53..6f0065f 100644 --- a/src/tridiag.jl +++ b/src/tridiag.jl @@ -22,7 +22,7 @@ regular matrix with `convert(Array, _)` (or `Array(_)` for short). # Examples ```jldoctest julia> ev = complex.([7, 8, 9] , [7, 8, 9]) -3-element Vector{Int64}: +3-element Vector{Complex{Int64}}: 7 + 7im 8 + 8im 9 + 9im diff --git a/test/runtests.jl b/test/runtests.jl index 35c2729..7ecd59e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -220,7 +220,7 @@ end @test exp(log(A)) ≈ A end if issuccess(lu(cos(B), check = false)) && issuccess(lu(det(exp(2A)+I), check = false)) - if isapproxskewhermitian(tan(B)) && isapproxskewhermitian(tanh(B)) + if isapproxskewhermitian(tan(B)) && isapproxskewhermitian(tanh(B)) @test tan(B) ≈ tan(A) @test tanh(B) ≈ tanh(A) end @@ -259,7 +259,7 @@ end @test exp(log(A)) ≈ A end if issuccess(lu(cos(B), check = false)) && issuccess(lu(det(exp(2A)+I), check = false)) - if isapproxskewhermitian(tan(B)) && isapproxskewhermitian(tanh(B)) + if isapproxskewhermitian(tan(B)) && isapproxskewhermitian(tanh(B)) @test tan(B) ≈ tan(A) @test tanh(B) ≈ tanh(A) end