Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored and dpo committed Oct 11, 2019
1 parent c5da0e3 commit 4806a00
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/diom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ This implementation allows a left preconditioner M and a right preconditioner N.
function diom(A :: AbstractLinearOperator, b :: AbstractVector{T};
M :: AbstractLinearOperator=opEye(),
N :: AbstractLinearOperator=opEye(),
atol :: T=eps(T), rtol :: T=eps(T), itmax :: Int=0, memory :: Int=20,
verbose :: Bool=false) where T <: AbstractFloat
atol :: T=eps(T), rtol :: T=eps(T), itmax :: Int=0,
memory :: Int=20, verbose :: Bool=false) where T <: AbstractFloat

m, n = size(A)
m == n || error("System must be square")
Expand Down
5 changes: 3 additions & 2 deletions src/dqgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ This implementation allows a left preconditioner M and a right preconditioner N.
"""
function dqgmres(A :: AbstractLinearOperator, b :: AbstractVector{T};
M :: AbstractLinearOperator=opEye(),
atol :: T=eps(T), rtol :: T=eps(T), itmax :: Int=0, memory :: Int=20,
verbose :: Bool=false) where T <: AbstractFloat
N :: AbstractLinearOperator=opEye(),
atol :: T=eps(T), rtol :: T=eps(T), itmax :: Int=0,
memory :: Int=20, verbose :: Bool=false) where T <: AbstractFloat

m, n = size(A)
m == n || error("System must be square")
Expand Down
11 changes: 3 additions & 8 deletions test/test_mp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function test_mp()
:dqgmres, :diom, :cr, :lslq, :lsqr, :lsmr, :craig,
:craigmr, :crls, :symmlq, :minres, :cg_lanczos_shift_seq,
:bilq, :minres_qlp)
@printf("%10s ", string(fn))
@printf("%s ", string(fn))
for T in (Float16, Float32, Float64, BigFloat)
M = spdiagm(-1 => -ones(T,n-1), 0 => 3*ones(T,n), 1 => -ones(T,n-1))
A = LinearOperator(M)
Expand All @@ -16,18 +16,13 @@ function test_mp()
shifts = [λ]
xs = @eval $fn($A, $b, $shifts)[1]
x = xs[1]
elseif fn == :usymqr
x = @eval $fn($A, $b, $c)[1]
else
x = @eval $fn($A, $b)[1]
end
atol = eps(T)
rtol = eps(T)
if fn == :usymqr
(x, stats) = @eval $fn($A, $b, $c)
else
(x, stats) = @eval $fn($A, $b)
end
@test norm(A * x - b) atol + norm(b) * rtol
end
if T == Float16
@test norm(A * x - b) 10 * (atol + norm(b) * rtol)
else
Expand Down
2 changes: 1 addition & 1 deletion test/test_variants.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tests of variants.jl
function test_variants()
@printf("\nTests of variants:\n")
@printf("Tests of variants:\n")
for fn in (:cg_lanczos, :cg_lanczos_shift_seq, :cg, :cgls, :cgne,
:cr, :craig, :craigmr, :crls, :crmr, :lslq, :lsmr, :bilq,
:lsqr, :minres, :symmlq, :dqgmres, :diom, :cgs, :usymqr,
Expand Down

0 comments on commit 4806a00

Please sign in to comment.