@@ -4,6 +4,7 @@ using ADTypes, SparseDiffTools, PolyesterForwardDiff, UnPack, Random, SparseArra
4
4
import ForwardDiff
5
5
import SparseDiffTools: AbstractMaybeSparseJacobianCache, AbstractMaybeSparsityDetection,
6
6
ForwardColorJacCache, NoMatrixColoring, sparse_jacobian_cache,
7
+ sparse_jacobian_cache_aux,
7
8
sparse_jacobian!,
8
9
sparse_jacobian_static_array, __standard_tag, __chunksize,
9
10
polyesterforwarddiff_color_jacobian
@@ -17,8 +18,8 @@ struct PolyesterForwardDiffJacobianCache{CO, CA, J, FX, X} <:
17
18
x:: X
18
19
end
19
20
20
- function sparse_jacobian_cache (
21
- ad:: Union{AutoSparsePolyesterForwardDiff , AutoPolyesterForwardDiff} ,
21
+ function sparse_jacobian_cache_aux ( :: ADTypes.ForwardMode ,
22
+ ad:: Union{AutoSparse{<:AutoPolyesterForwardDiff} , AutoPolyesterForwardDiff} ,
22
23
sd:: AbstractMaybeSparsityDetection , f:: F , x; fx = nothing ) where {F}
23
24
coloring_result = sd (ad, f, x)
24
25
fx = fx === nothing ? similar (f (x)) : fx
@@ -35,8 +36,8 @@ function sparse_jacobian_cache(
35
36
return PolyesterForwardDiffJacobianCache (coloring_result, cache, jac_prototype, fx, x)
36
37
end
37
38
38
- function sparse_jacobian_cache (
39
- ad:: Union{AutoSparsePolyesterForwardDiff , AutoPolyesterForwardDiff} ,
39
+ function sparse_jacobian_cache_aux ( :: ADTypes.ForwardMode ,
40
+ ad:: Union{AutoSparse{<:AutoPolyesterForwardDiff} , AutoPolyesterForwardDiff} ,
40
41
sd:: AbstractMaybeSparsityDetection , f!:: F , fx, x) where {F}
41
42
coloring_result = sd (ad, f!, fx, x)
42
43
if coloring_result isa NoMatrixColoring
77
78
78
79
# # Approximate Sparsity Detection
79
80
function (alg:: ApproximateJacobianSparsity )(
80
- ad:: AutoSparsePolyesterForwardDiff , f:: F , x; fx = nothing , kwargs... ) where {F}
81
+ ad:: AutoSparse{<:AutoPolyesterForwardDiff} , f:: F , x; fx = nothing , kwargs... ) where {F}
81
82
@unpack ntrials, rng = alg
82
83
fx = fx === nothing ? f (x) : fx
83
84
ck = __chunksize (ad, x)
@@ -94,7 +95,7 @@ function (alg::ApproximateJacobianSparsity)(
94
95
end
95
96
96
97
function (alg:: ApproximateJacobianSparsity )(
97
- ad:: AutoSparsePolyesterForwardDiff , f:: F , fx, x;
98
+ ad:: AutoSparse{<:AutoPolyesterForwardDiff} , f:: F , fx, x;
98
99
kwargs... ) where {F}
99
100
@unpack ntrials, rng = alg
100
101
ck = __chunksize (ad, x)
0 commit comments