Skip to content

Commit b625182

Browse files
committed
Make BandedMatrix used in test of in-place autodiff of oop f actually sparse.
1 parent f6c4023 commit b625182

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/test_ad.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ forwarddiff_color_jacobian(_oop_jacout, oopf, x; colorvec = repeat(1:3,10), spar
124124
@test typeof(_oop_jacout) == typeof(_J)
125125
@test fcalls == 1
126126

127-
_oop_jacout = BandedMatrix(1.01 .* _oop_jacout) # check w/BandedMatrix instead of sparse
127+
# BandedMatrix
128+
_oop_jacout = BandedMatrix(-1 => diag(J, -1) .* 1.01, 0 => diag(J, 0) .* 1.01,
129+
1 => diag(J, 1) .* 1.01) # check w/BandedMatrix instead of sparse
128130
fcalls = 0
129-
forwarddiff_color_jacobian(_oop_jacout, oopf, x; colorvec = repeat(1:3,10), sparsity = _J, jac_prototype = _J)
131+
forwarddiff_color_jacobian(_oop_jacout, oopf, x; colorvec = repeat(1:3,10), sparsity = _J)
130132
@test _oop_jacout J
131133
@test isa(_oop_jacout, BandedMatrix)
132134
@test fcalls == 1

0 commit comments

Comments
 (0)