@@ -4,6 +4,7 @@ using ADTypes, SparseDiffTools, PolyesterForwardDiff, UnPack, Random, SparseArra
44import ForwardDiff
55import SparseDiffTools: AbstractMaybeSparseJacobianCache, AbstractMaybeSparsityDetection,
66 ForwardColorJacCache, NoMatrixColoring, sparse_jacobian_cache,
7+ sparse_jacobian_cache_aux,
78 sparse_jacobian!,
89 sparse_jacobian_static_array, __standard_tag, __chunksize,
910 polyesterforwarddiff_color_jacobian
@@ -17,8 +18,8 @@ struct PolyesterForwardDiffJacobianCache{CO, CA, J, FX, X} <:
1718 x:: X
1819end
1920
20- function sparse_jacobian_cache (
21- ad:: Union{AutoSparsePolyesterForwardDiff , AutoPolyesterForwardDiff} ,
21+ function sparse_jacobian_cache_aux ( :: ADTypes.ForwardMode ,
22+ ad:: Union{AutoSparse{<:AutoPolyesterForwardDiff} , AutoPolyesterForwardDiff} ,
2223 sd:: AbstractMaybeSparsityDetection , f:: F , x; fx = nothing ) where {F}
2324 coloring_result = sd (ad, f, x)
2425 fx = fx === nothing ? similar (f (x)) : fx
@@ -35,8 +36,8 @@ function sparse_jacobian_cache(
3536 return PolyesterForwardDiffJacobianCache (coloring_result, cache, jac_prototype, fx, x)
3637end
3738
38- function sparse_jacobian_cache (
39- ad:: Union{AutoSparsePolyesterForwardDiff , AutoPolyesterForwardDiff} ,
39+ function sparse_jacobian_cache_aux ( :: ADTypes.ForwardMode ,
40+ ad:: Union{AutoSparse{<:AutoPolyesterForwardDiff} , AutoPolyesterForwardDiff} ,
4041 sd:: AbstractMaybeSparsityDetection , f!:: F , fx, x) where {F}
4142 coloring_result = sd (ad, f!, fx, x)
4243 if coloring_result isa NoMatrixColoring
7778
7879# # Approximate Sparsity Detection
7980function (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}
8182 @unpack ntrials, rng = alg
8283 fx = fx === nothing ? f (x) : fx
8384 ck = __chunksize (ad, x)
@@ -94,7 +95,7 @@ function (alg::ApproximateJacobianSparsity)(
9495end
9596
9697function (alg:: ApproximateJacobianSparsity )(
97- ad:: AutoSparsePolyesterForwardDiff , f:: F , fx, x;
98+ ad:: AutoSparse{<:AutoPolyesterForwardDiff} , f:: F , fx, x;
9899 kwargs... ) where {F}
99100 @unpack ntrials, rng = alg
100101 ck = __chunksize (ad, x)
0 commit comments