Skip to content

Commit fc4ae65

Browse files
committed
format; let failing tests for duals ring
1 parent 974ff9e commit fc4ae65

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

src/iterative_wrappers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ function SciMLBase.solve(cache::LinearCache, alg::KrylovJL; kwargs...)
154154
N = (N === Identity()) ? I : InvPreconditioner(N)
155155

156156
Ta = eltype(cache.A)
157-
157+
158158
atol = Ta(float(cache.abstol))
159159
rtol = Ta(float(cache.reltol))
160160
itmax = cache.maxiters
161161
verbose = cache.verbose ? 1 : 0
162-
162+
163163
args = (cache.cacheval, cache.A, cache.b)
164164
kwargs = (atol = atol, rtol = rtol, itmax = itmax, verbose = verbose,
165165
history = true, alg.kwargs...)

test/basictests.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ using Test
33
import Random
44

55
const Dual64 = ForwardDiff.Dual{Nothing, Float64, 1}
6-
Base.:^(x::MultiFloat{T, N}, y::Int) where {T,N} = MultiFloat{T, N}(BigFloat(x)^y)
7-
Base.:^(x::MultiFloat{T, N}, y::Float64) where {T,N} = MultiFloat{T, N}(BigFloat(x)^y)
6+
Base.:^(x::MultiFloat{T, N}, y::Int) where {T, N} = MultiFloat{T, N}(BigFloat(x)^y)
7+
Base.:^(x::MultiFloat{T, N}, y::Float64) where {T, N} = MultiFloat{T, N}(BigFloat(x)^y)
88

99
n = 8
1010
A = Matrix(I, n, n)
@@ -21,7 +21,7 @@ prob2 = LinearProblem(A2, b2; u0 = x2)
2121

2222
cache_kwargs = (; verbose = true, abstol = 1e-8, reltol = 1e-8, maxiter = 30)
2323

24-
function test_interface(alg, prob1, prob2; T=Float64)
24+
function test_interface(alg, prob1, prob2; T = Float64)
2525
A1 = prob1.A .|> T
2626
b1 = prob1.b .|> T
2727
x1 = prob1.u0 .|> T
@@ -31,7 +31,7 @@ function test_interface(alg, prob1, prob2; T=Float64)
3131

3232
myprob1 = LinearProblem(A1, b1; u0 = x1)
3333
myprob2 = LinearProblem(A2, b2; u0 = x2)
34-
34+
3535
y = solve(myprob1, alg; cache_kwargs...)
3636
@test A1 * y b1
3737

@@ -154,7 +154,7 @@ end
154154

155155
prob1 = LinearProblem(A1, b1; u0 = x1)
156156
prob2 = LinearProblem(A2, b2; u0 = x2)
157-
test_interface(SparspakFactorization(), prob1, prob2; T=Float64x1)
157+
test_interface(SparspakFactorization(), prob1, prob2; T = Float64x1)
158158
end
159159

160160
@testset "Sparspak Factorization (Float64x2)" begin
@@ -167,7 +167,7 @@ end
167167

168168
prob1 = LinearProblem(A1, b1; u0 = x1)
169169
prob2 = LinearProblem(A2, b2; u0 = x2)
170-
test_interface(SparspakFactorization(), prob1, prob2; T=Float64x2)
170+
test_interface(SparspakFactorization(), prob1, prob2; T = Float64x2)
171171
end
172172

173173
@testset "Sparspak Factorization (Dual64)" begin
@@ -180,9 +180,9 @@ end
180180

181181
prob1 = LinearProblem(A1, b1; u0 = x1)
182182
prob2 = LinearProblem(A2, b2; u0 = x2)
183-
test_interface(SparspakFactorization(), prob1, prob2; T=Dual64)
183+
test_interface(SparspakFactorization(), prob1, prob2; T = Dual64)
184184
end
185-
185+
186186
@testset "FastLAPACK Factorizations" begin
187187
A1 = A / 1
188188
b1 = rand(n)
@@ -232,9 +232,9 @@ end
232232
("MINRES", KrylovJL_MINRES(kwargs...)))
233233
@testset "$(alg[1])" begin
234234
test_interface(alg[2], prob1, prob2)
235-
test_interface(alg[2], prob1, prob2; T=Float64x1)
236-
test_interface(alg[2], prob1, prob2; T=Float64x2)
237-
# test_interface(alg[2], prob1, prob2; T=Dual64)
235+
test_interface(alg[2], prob1, prob2; T = Float64x1)
236+
test_interface(alg[2], prob1, prob2; T = Float64x2)
237+
test_interface(alg[2], prob1, prob2; T = Dual64)
238238
# https://github.com/JuliaSmoothOptimizers/Krylov.jl/issues/646
239239
# ForwardDiff.Dual is a Real, not an AbstractFloat
240240
end
@@ -251,10 +251,10 @@ end
251251
)
252252
@testset "$(alg[1])" begin
253253
test_interface(alg[2], prob1, prob2)
254-
test_interface(alg[2], prob1, prob2; T=Float64x1)
255-
test_interface(alg[2], prob1, prob2; T=Float64x2)
256-
# test_interface(alg[2], prob1, prob2; T=Dual64)
257-
# https://github.com/JuliaLang/julia/blob/master/stdlib/LinearAlgebra/src/givens.jl#L77
254+
test_interface(alg[2], prob1, prob2; T = Float64x1)
255+
test_interface(alg[2], prob1, prob2; T = Float64x2)
256+
test_interface(alg[2], prob1, prob2; T = Dual64)
257+
# https://github.com/JuliaLang/julia/issues/41753
258258
# ForwardDiff.Dual is a Real, not an AbstractFloat
259259
end
260260
end
@@ -267,9 +267,9 @@ end
267267
("GMRES", KrylovKitJL_GMRES(kwargs...)))
268268
@testset "$(alg[1])" begin
269269
test_interface(alg[2], prob1, prob2)
270-
test_interface(alg[2], prob1, prob2; T=Float64x1)
271-
test_interface(alg[2], prob1, prob2; T=Float64x2)
272-
test_interface(alg[2], prob1, prob2; T=Dual64)
270+
test_interface(alg[2], prob1, prob2; T = Float64x1)
271+
test_interface(alg[2], prob1, prob2; T = Float64x2)
272+
test_interface(alg[2], prob1, prob2; T = Dual64)
273273
end
274274
@test alg[2] isa KrylovKitJL
275275
end

0 commit comments

Comments
 (0)