Skip to content

Commit ce54cb1

Browse files
fix tests
1 parent 6a27901 commit ce54cb1

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/runtests.jl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ end
205205
x = rand(n,n)
206206
y = rand(n,n)
207207

208-
Pl, Pr = LinearSolve.scaling_preconditioner(s)
208+
Pl, Pr = LinearSolve.scaling_preconditioner(1/s)
209209

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

220220
@testset "vector scaling_preconditioner" begin
221221
s = rand(n)
222-
Pl, Pr = LinearSolve.scaling_preconditioner(s)
222+
Pl, Pr = LinearSolve.scaling_preconditioner(1 ./ s)
223223

224-
mul!(y, Pl, x); @test y s * x
225-
mul!(y, Pr, x); @test y s \ x
224+
x = rand(n,n)
225+
y = rand(n,n)
226226

227-
y .= x; ldiv!(Pl, x); @test x s \ y
228-
y .= x; ldiv!(Pr, x); @test x s * y
227+
mul!(y, Pl, x); @test y s .* x
228+
mul!(y, Pr, x); @test y s .\ x
229229

230-
ldiv!(y, Pl, x); @test y s \ x
231-
ldiv!(y, Pr, x); @test y s * x
230+
y .= x; ldiv!(Pl, x); @test x s .\ y
231+
y .= x; ldiv!(Pr, x); @test x s .* y
232+
233+
ldiv!(y, Pl, x); @test y s .\ x
234+
ldiv!(y, Pr, x); @test y s .* x
232235
end
233236

234237
@testset "ComposePreconditioenr" begin

0 commit comments

Comments
 (0)