@@ -3,8 +3,8 @@ using Test
3
3
import Random
4
4
5
5
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)
8
8
9
9
n = 8
10
10
A = Matrix (I, n, n)
@@ -21,7 +21,7 @@ prob2 = LinearProblem(A2, b2; u0 = x2)
21
21
22
22
cache_kwargs = (; verbose = true , abstol = 1e-8 , reltol = 1e-8 , maxiter = 30 )
23
23
24
- function test_interface (alg, prob1, prob2; T= Float64)
24
+ function test_interface (alg, prob1, prob2; T = Float64)
25
25
A1 = prob1. A .| > T
26
26
b1 = prob1. b .| > T
27
27
x1 = prob1. u0 .| > T
@@ -31,7 +31,7 @@ function test_interface(alg, prob1, prob2; T=Float64)
31
31
32
32
myprob1 = LinearProblem (A1, b1; u0 = x1)
33
33
myprob2 = LinearProblem (A2, b2; u0 = x2)
34
-
34
+
35
35
y = solve (myprob1, alg; cache_kwargs... )
36
36
@test A1 * y ≈ b1
37
37
154
154
155
155
prob1 = LinearProblem (A1, b1; u0 = x1)
156
156
prob2 = LinearProblem (A2, b2; u0 = x2)
157
- test_interface (SparspakFactorization (), prob1, prob2; T= Float64x1)
157
+ test_interface (SparspakFactorization (), prob1, prob2; T = Float64x1)
158
158
end
159
159
160
160
@testset " Sparspak Factorization (Float64x2)" begin
167
167
168
168
prob1 = LinearProblem (A1, b1; u0 = x1)
169
169
prob2 = LinearProblem (A2, b2; u0 = x2)
170
- test_interface (SparspakFactorization (), prob1, prob2; T= Float64x2)
170
+ test_interface (SparspakFactorization (), prob1, prob2; T = Float64x2)
171
171
end
172
172
173
173
@testset " Sparspak Factorization (Dual64)" begin
180
180
181
181
prob1 = LinearProblem (A1, b1; u0 = x1)
182
182
prob2 = LinearProblem (A2, b2; u0 = x2)
183
- test_interface (SparspakFactorization (), prob1, prob2; T= Dual64)
183
+ test_interface (SparspakFactorization (), prob1, prob2; T = Dual64)
184
184
end
185
-
185
+
186
186
@testset " FastLAPACK Factorizations" begin
187
187
A1 = A / 1
188
188
b1 = rand (n)
232
232
(" MINRES" , KrylovJL_MINRES (kwargs... )))
233
233
@testset " $(alg[1 ]) " begin
234
234
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)
238
238
# https://github.com/JuliaSmoothOptimizers/Krylov.jl/issues/646
239
239
# ForwardDiff.Dual is a Real, not an AbstractFloat
240
240
end
@@ -251,10 +251,10 @@ end
251
251
)
252
252
@testset " $(alg[1 ]) " begin
253
253
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
258
258
# ForwardDiff.Dual is a Real, not an AbstractFloat
259
259
end
260
260
end
267
267
(" GMRES" , KrylovKitJL_GMRES (kwargs... )))
268
268
@testset " $(alg[1 ]) " begin
269
269
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)
273
273
end
274
274
@test alg[2 ] isa KrylovKitJL
275
275
end
0 commit comments