@@ -24,12 +24,11 @@ krylov_u0_sol = solve(krylov_prob, KrylovJL_GMRES())
24
24
25
25
@test ≈ (krylov_u0_sol, backslash_x_p, rtol = 1e-9 )
26
26
27
-
28
27
A, _ = h ([ForwardDiff. Dual (5.0 , 1.0 , 0.0 ), ForwardDiff. Dual (5.0 , 0.0 , 1.0 )])
29
28
backslash_x_p = A \ [6.0 , 10.0 , 25.0 ]
30
29
prob = LinearProblem (A, [6.0 , 10.0 , 25.0 ])
31
30
32
- @test ≈ (solve (prob). u, backslash_x_p, rtol = 1e-9 )
31
+ @test ≈ (solve (prob). u, backslash_x_p, rtol = 1e-9 )
33
32
@test ≈ (solve (prob, KrylovJL_GMRES ()). u, backslash_x_p, rtol = 1e-9 )
34
33
35
34
_, b = h ([ForwardDiff. Dual (5.0 , 1.0 , 0.0 ), ForwardDiff. Dual (5.0 , 0.0 , 1.0 )])
@@ -117,7 +116,6 @@ cache.b = new_b
117
116
@test cache. A == new_A
118
117
@test cache. b == new_b
119
118
120
-
121
119
function linprob_f (p)
122
120
A, b = h (p)
123
121
prob = LinearProblem (A, b)
@@ -129,7 +127,8 @@ function slash_f(p)
129
127
A \ b
130
128
end
131
129
132
- @test ≈ (ForwardDiff. jacobian (slash_f, [5.0 , 5.0 ]), ForwardDiff. jacobian (linprob_f, [5.0 , 5.0 ]))
130
+ @test ≈ (
131
+ ForwardDiff. jacobian (slash_f, [5.0 , 5.0 ]), ForwardDiff. jacobian (linprob_f, [5.0 , 5.0 ]))
133
132
134
133
@test ≈ (ForwardDiff. jacobian (p -> ForwardDiff. jacobian (slash_f, [5.0 , p[1 ]]), [5.0 ]),
135
134
ForwardDiff. jacobian (p -> ForwardDiff. jacobian (linprob_f, [5.0 , p[1 ]]), [5.0 ]))
157
156
@test ≈ (ForwardDiff. hessian (slash_f_hes, [5.0 ]),
158
157
ForwardDiff. hessian (linprob_f_hes, [5.0 ]))
159
158
160
-
161
159
# Test aliasing
160
+ A, b = h ([ForwardDiff. Dual (5.0 , 1.0 , 0.0 ), ForwardDiff. Dual (5.0 , 0.0 , 1.0 )])
162
161
163
162
prob = LinearProblem (A, b)
164
163
cache = init (prob)
@@ -175,7 +174,6 @@ backslash_x_p = new_A \ new_b
175
174
176
175
@test linu == cache. u
177
176
178
-
179
177
# Test Float Only solvers
180
178
181
179
A, b = h ([ForwardDiff. Dual (5.0 , 1.0 , 0.0 ), ForwardDiff. Dual (5.0 , 0.0 , 1.0 )])
0 commit comments