Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Dec 14, 2021
1 parent 6a27901 commit ce54cb1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ end
x = rand(n,n)
y = rand(n,n)

Pl, Pr = LinearSolve.scaling_preconditioner(s)
Pl, Pr = LinearSolve.scaling_preconditioner(1/s)

mul!(y, Pl, x); @test y s * x
mul!(y, Pr, x); @test y s \ x
Expand All @@ -219,16 +219,19 @@ end

@testset "vector scaling_preconditioner" begin
s = rand(n)
Pl, Pr = LinearSolve.scaling_preconditioner(s)
Pl, Pr = LinearSolve.scaling_preconditioner(1 ./ s)

mul!(y, Pl, x); @test y s * x
mul!(y, Pr, x); @test y s \ x
x = rand(n,n)
y = rand(n,n)

y .= x; ldiv!(Pl, x); @test x s \ y
y .= x; ldiv!(Pr, x); @test x s * y
mul!(y, Pl, x); @test y s .* x
mul!(y, Pr, x); @test y s .\ x

ldiv!(y, Pl, x); @test y s \ x
ldiv!(y, Pr, x); @test y s * x
y .= x; ldiv!(Pl, x); @test x s .\ y
y .= x; ldiv!(Pr, x); @test x s .* y

ldiv!(y, Pl, x); @test y s .\ x
ldiv!(y, Pr, x); @test y s .* x
end

@testset "ComposePreconditioenr" begin
Expand Down

0 comments on commit ce54cb1

Please sign in to comment.