114
114
115
115
"""
116
116
ApproximateJacobianSparsity(; ntrials = 5, rng = Random.default_rng(),
117
- alg = GreedyD1Color())
117
+ epsilon = nothing, alg = GreedyD1Color())
118
118
119
119
Use `ntrials` random vectors to compute the sparsity pattern of the Jacobian. This is an
120
120
approximate method and the sparsity pattern may not be exact.
@@ -124,17 +124,21 @@ approximate method and the sparsity pattern may not be exact.
124
124
- `ntrials`: The number of random vectors to use for computing the sparsity pattern
125
125
- `rng`: The random number generator used for generating the random vectors
126
126
- `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))`
127
130
"""
128
- struct ApproximateJacobianSparsity{R <: AbstractRNG ,
129
- A <: ArrayInterface.ColoringAlgorithm } <: AbstractSparsityDetection
131
+ struct ApproximateJacobianSparsity{R <: AbstractRNG , A <: ArrayInterface.ColoringAlgorithm ,
132
+ E } <: AbstractSparsityDetection
130
133
ntrials:: Int
131
134
rng:: R
132
135
alg:: A
136
+ epsilon:: E
133
137
end
134
138
135
- function ApproximateJacobianSparsity (; ntrials:: Int = 3 ,
139
+ function ApproximateJacobianSparsity (; ntrials:: Int = 3 , epsilon = nothing ,
136
140
rng:: AbstractRNG = Random. default_rng (), alg = GreedyD1Color ())
137
- return ApproximateJacobianSparsity (ntrials, rng, alg)
141
+ return ApproximateJacobianSparsity (ntrials, rng, alg, epsilon )
138
142
end
139
143
140
144
# No one should be using this currently
0 commit comments