Skip to content

Commit 0d33617

Browse files
Merge pull request #138 from DanielVandH/patch-1
Typo: x -> x1
2 parents 8127aba + 8ee3c97 commit 0d33617

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ FiniteDiff.JacobianCache(
476476
fx1,
477477
fdtype :: Type{T1} = Val{:central},
478478
returntype :: Type{T2} = eltype(fx),
479-
colorvec = 1:length(x),
479+
colorvec = 1:length(x1),
480480
sparsity = nothing)
481481
```
482482

test/finitedifftests.jl

+7
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ df = zero(x)
330330
df_ref = diag(J_ref)
331331
epsilon = zero(x)
332332
forward_cache = FiniteDiff.JacobianCache(x,Val{:forward},eltype(x))
333+
@test forward_cache.colorvec == 1:length(x)
333334
central_cache = FiniteDiff.JacobianCache(x,Val{:central},eltype(x))
334335
complex_cache = FiniteDiff.JacobianCache(x,Val{:complex},eltype(x))
335336
f_in = copy(y)
@@ -435,6 +436,12 @@ f_in = oopf(x)
435436
@test err_func(FiniteDiff.finite_difference_jacobian(oopf, x, complex_cache), J_ref) < 1e-14
436437
end
437438

439+
# Test default colorvec construction
440+
θ = rand(2)
441+
y0 = rand(1)
442+
cache = FiniteDiff.JacobianCache(copy(θ), copy(y0), copy(y0), Val(:forward))
443+
@test cache.colorvec == 1:length(θ)
444+
438445
# Hessian tests
439446

440447
f(x) = sin(x[1]) + cos(x[2])

0 commit comments

Comments
 (0)