File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 43
43
44
44
For this function, we know that the sparsity pattern of the Jacobian is a
45
45
` Tridiagonal ` matrix. However, if we didn't know the sparsity pattern for
46
- the Jacobian, we could use the ` sparsity! ` function to automatically
46
+ the Jacobian, we could use the ` jacobian_sparsity ` function to automatically
47
47
detect the sparsity pattern. This function is only available if you
48
48
load SparsityDetection.jl as well. We declare that the function ` f ` outputs a
49
- vector of length 30 and takes in a vector of length 30, and ` sparsity! ` spits
49
+ vector of length 30 and takes in a vector of length 30, and ` jacobian_sparsity ` spits
50
50
out a ` Sparsity ` object which we can turn into a ` SparseMatrixCSC ` :
51
51
52
52
``` julia
53
53
using SparsityDetection, SparseArrays
54
54
input = rand (30 )
55
55
output = similar (input)
56
- sparsity_pattern = sparsity! (f,output,input)
56
+ sparsity_pattern = jacobian_sparsity (f,output,input)
57
57
jac = Float64 .(sparse (sparsity_pattern))
58
58
```
59
59
You can’t perform that action at this time.
0 commit comments