Skip to content

Commit 78ec62e

Browse files
diffeqdifftools -> FiniteDiff
1 parent c7ae55d commit 78ec62e

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
88
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
99
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
1010
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
11-
DiffEqDiffTools = "01453d9d-ee7c-5054-8395-0335cb756afa"
1211
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
12+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
1313
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1414
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1515
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
@@ -22,7 +22,7 @@ Adapt = "1"
2222
ArrayInterface = "1.1, 2.0"
2323
Compat = "2.2, 3"
2424
DataStructures = "0.17"
25-
DiffEqDiffTools = "1.7"
25+
FiniteDiff = "2"
2626
ForwardDiff = "0.10"
2727
LightGraphs = "1.3"
2828
Requires = "0.5, 1.0"

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ pattern used 1 (pseudo) `f`-evaluation, so the total number of times that
7171
is 5 times:
7272

7373
```julia
74-
using DiffEqDiffTools
75-
DiffEqDiffTools.finite_difference_jacobian!(jac, f, rand(30), colorvec=colors)
74+
using FiniteDiff
75+
FiniteDiff.finite_difference_jacobian!(jac, f, rand(30), colorvec=colors)
7676
@show fcalls # 5
7777
```
7878

@@ -141,12 +141,12 @@ The result is a vector which assigns a colorvec to each column (or row) of the m
141141
### Colorvec-Assisted Differentiation
142142

143143
Colorvec-assisted differentiation for numerical differentiation is provided by
144-
DiffEqDiffTools.jl and for automatic differentiation is provided by
144+
FiniteDiff.jl and for automatic differentiation is provided by
145145
ForwardDiff.jl.
146146

147-
For DiffEqDiffTools.jl, one simply has to use the provided `colorvec` keyword
147+
For FiniteDiff.jl, one simply has to use the provided `colorvec` keyword
148148
argument. See
149-
[the DiffEqDiffTools Jacobian documentation](https://github.com/JuliaDiff/DiffEqDiffTools.jl#jacobians)
149+
[the FiniteDiff Jacobian documentation](https://github.com/JuliaDiff/FiniteDiff.jl#jacobians)
150150
for more details.
151151

152152
For forward-mode automatic differentiation, use of a colorvec vector is provided

src/SparseDiffTools.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module SparseDiffTools
22

33
using Compat
4-
using DiffEqDiffTools
4+
using FiniteDiff
55
using ForwardDiff
66
using LightGraphs
77
using Requires

src/differentiation/compute_jacobian_ad.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
153153
maxcolor = maximum(colorvec)
154154
fill!(J, zero(eltype(J)))
155155

156-
if DiffEqDiffTools._use_findstructralnz(sparsity)
156+
if FiniteDiff._use_findstructralnz(sparsity)
157157
rows_index, cols_index = ArrayInterface.findstructralnz(sparsity)
158158
else
159159
rows_index = nothing
@@ -176,7 +176,7 @@ function forwarddiff_color_jacobian!(J::AbstractMatrix{<:Number},
176176
dx .= partials.(fx, j)
177177
if ArrayInterface.fast_scalar_indexing(dx)
178178
#dx is implicitly used in vecdx
179-
DiffEqDiffTools._colorediteration!(J,sparsity,rows_index,cols_index,vecdx,colorvec,color_i,ncols)
179+
FiniteDiff._colorediteration!(J,sparsity,rows_index,cols_index,vecdx,colorvec,color_i,ncols)
180180
else
181181
#=
182182
J.nzval[rows_index] .+= (colorvec[cols_index] .== color_i) .* dx[rows_index]

src/differentiation/jaches_products.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function num_hesvec!(du,f,x,v,
3737
cache1 = similar(v),
3838
cache2 = similar(v),
3939
cache3 = similar(v))
40-
cache = DiffEqDiffTools.GradientCache(v[1],cache1,Val{:central})
40+
cache = FiniteDiff.GradientCache(v[1],cache1,Val{:central})
4141
g = let f=f,cache=cache
42-
(dx,x) -> DiffEqDiffTools.finite_difference_gradient!(dx,f,x,cache)
42+
(dx,x) -> FiniteDiff.finite_difference_gradient!(dx,f,x,cache)
4343
end
4444
T = eltype(x)
4545
# Should it be min? max? mean?
@@ -52,7 +52,7 @@ function num_hesvec!(du,f,x,v,
5252
end
5353

5454
function num_hesvec(f,x,v)
55-
g = (x) -> DiffEqDiffTools.finite_difference_gradient(f,x)
55+
g = (x) -> FiniteDiff.finite_difference_gradient(f,x)
5656
T = eltype(x)
5757
# Should it be min? max? mean?
5858
ϵ = sqrt(eps(real(T))) * max(one(real(T)), abs(norm(x)))
@@ -96,15 +96,15 @@ function autonum_hesvec!(du,f,x,v,
9696
cache1 = similar(v),
9797
cache2 = ForwardDiff.Dual{DeivVecTag}.(x, v),
9898
cache3 = ForwardDiff.Dual{DeivVecTag}.(x, v))
99-
cache = DiffEqDiffTools.GradientCache(v[1],cache1,Val{:central})
100-
g = (dx,x) -> DiffEqDiffTools.finite_difference_gradient!(dx,f,x,cache)
99+
cache = FiniteDiff.GradientCache(v[1],cache1,Val{:central})
100+
g = (dx,x) -> FiniteDiff.finite_difference_gradient!(dx,f,x,cache)
101101
cache2 .= Dual{DeivVecTag}.(x, v)
102102
g(cache3,cache2)
103103
du .= partials.(cache3, 1)
104104
end
105105

106106
function autonum_hesvec(f,x,v)
107-
g = (x) -> DiffEqDiffTools.finite_difference_gradient(f,x)
107+
g = (x) -> FiniteDiff.finite_difference_gradient(f,x)
108108
partials.(g(Dual{DeivVecTag}.(x, v)), 1)
109109
end
110110

test/test_ad.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ _Jt = similar(Tridiagonal(J))
203203
forwarddiff_color_jacobian!(_Jt, f, x, colorvec = repeat(1:3,10), sparsity = _Jt)
204204
@test _Jt J
205205

206-
#https://github.com/JuliaDiff/DiffEqDiffTools.jl/issues/67#issuecomment-516871956
206+
#https://github.com/JuliaDiff/FiniteDiff.jl/issues/67#issuecomment-516871956
207207
function f(out, x)
208208
x = reshape(x, 100, 100)
209209
out = reshape(out, 100, 100)

test/test_integration.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using SparseDiffTools
2-
using DiffEqDiffTools: finite_difference_jacobian, finite_difference_jacobian!
2+
using FiniteDiff: finite_difference_jacobian, finite_difference_jacobian!
33
using SparsityDetection
44

55
using LinearAlgebra, SparseArrays, Test

test/test_jaches_products.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using SparseDiffTools, ForwardDiff, DiffEqDiffTools, Zygote, IterativeSolvers
1+
using SparseDiffTools, ForwardDiff, FiniteDiff, Zygote, IterativeSolvers
22
using LinearAlgebra, Test
33

44
using Random
@@ -12,10 +12,10 @@ v = rand(300)
1212
du = similar(x)
1313
g(u) = sum(abs2,u)
1414
function h(x)
15-
DiffEqDiffTools.finite_difference_gradient(g,x)
15+
FiniteDiff.finite_difference_gradient(g,x)
1616
end
1717
function h(dx,x)
18-
DiffEqDiffTools.finite_difference_gradient!(dx,g,x)
18+
FiniteDiff.finite_difference_gradient!(dx,g,x)
1919
end
2020

2121
cache1 = ForwardDiff.Dual{SparseDiffTools.DeivVecTag}.(x, v)

0 commit comments

Comments
 (0)