Skip to content

Commit c6b5fe7

Browse files
authored
Fix ForwardDiff
1 parent 4d34cd6 commit c6b5fe7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/adjoint.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ using FiniteDiff, RecursiveFactorization
44
using LazyArrays: BroadcastArray
55

66
n = 4
7-
A = rand(n, n) + 1im * rand(n, n);
8-
b1 = rand(n) + 1im * rand(n);
7+
A = rand(n, n)
8+
b1 = rand(n)
99

1010
function f(A, b1; alg = LUFactorization())
1111
prob = LinearProblem(A, b1)
@@ -85,8 +85,9 @@ db22 = ForwardDiff.gradient(x -> f4(eltype(x).(A), eltype(x).(b1), x), copy(b1))
8585
@test db1 db12
8686
@test db2 db22
8787

88-
A = rand(n, n);
89-
b1 = rand(n);
88+
# Test complex numbers
89+
A = rand(n, n) + 1im * rand(n, n);
90+
b1 = rand(n) + 1im * rand(n);
9091
for alg in (
9192
LUFactorization(),
9293
RFLUFactorization(),

0 commit comments

Comments
 (0)