114114
115115"""
116116 ApproximateJacobianSparsity(; ntrials = 5, rng = Random.default_rng(),
117- alg = GreedyD1Color())
117+ epsilon = nothing, alg = GreedyD1Color())
118118
119119Use `ntrials` random vectors to compute the sparsity pattern of the Jacobian. This is an
120120approximate method and the sparsity pattern may not be exact.
@@ -124,17 +124,21 @@ approximate method and the sparsity pattern may not be exact.
124124 - `ntrials`: The number of random vectors to use for computing the sparsity pattern
125125 - `rng`: The random number generator used for generating the random vectors
126126 - `alg`: The algorithm used for computing the matrix colors
127+ - `epsilon`: For Finite Differencing based Jacobian Approximations, any number smaller
128+ than `epsilon` is considered to be zero. If `nothing` is specified, then this value
129+ is calculated as `100 * eps(eltype(x))`
127130"""
128- struct ApproximateJacobianSparsity{R <: AbstractRNG ,
129- A <: ArrayInterface.ColoringAlgorithm } <: AbstractSparsityDetection
131+ struct ApproximateJacobianSparsity{R <: AbstractRNG , A <: ArrayInterface.ColoringAlgorithm ,
132+ E } <: AbstractSparsityDetection
130133 ntrials:: Int
131134 rng:: R
132135 alg:: A
136+ epsilon:: E
133137end
134138
135- function ApproximateJacobianSparsity (; ntrials:: Int = 3 ,
139+ function ApproximateJacobianSparsity (; ntrials:: Int = 3 , epsilon = nothing ,
136140 rng:: AbstractRNG = Random. default_rng (), alg = GreedyD1Color ())
137- return ApproximateJacobianSparsity (ntrials, rng, alg)
141+ return ApproximateJacobianSparsity (ntrials, rng, alg, epsilon )
138142end
139143
140144# No one should be using this currently
0 commit comments