@@ -44,7 +44,7 @@ sparsity_pattern = sparsity!(f,output,input)
44
44
jac = Float64 .(sparse (sparsity_pattern))
45
45
```
46
46
47
- Now we call ` matrix_colors ` to get the color vector for that matrix:
47
+ Now we call ` matrix_colors ` to get the colorvec vector for that matrix:
48
48
49
49
``` julia
50
50
colors = matrix_colors (jac)
@@ -54,14 +54,14 @@ Since `maximum(colors)` is 3, this means that finite differencing can now
54
54
compute the Jacobian in just 4 ` f ` -evaluations:
55
55
56
56
``` julia
57
- DiffEqDiffTools. finite_difference_jacobian! (jac, f, rand (30 ), color = colors)
57
+ DiffEqDiffTools. finite_difference_jacobian! (jac, f, rand (30 ), colorvec = colors)
58
58
@show fcalls # 4
59
59
```
60
60
61
61
In addition, a faster forward-mode autodiff call can be utilized as well:
62
62
63
63
``` julia
64
- forwarddiff_color_jacobian! (jac, f, x, color = colors)
64
+ forwarddiff_color_jacobian! (jac, f, x, colorvec = colors)
65
65
```
66
66
67
67
If one only need to compute products, one can use the operators. For example,
@@ -102,7 +102,7 @@ requires an `f` call to `maximum(colors)+1`, or reduces automatic differentiatio
102
102
to using ` maximum(colors) ` partials. Since normally these values are ` length(x) ` ,
103
103
this can be significant savings.
104
104
105
- The API for computing the color vector is:
105
+ The API for computing the colorvec vector is:
106
106
107
107
``` julia
108
108
matrix_colors (A:: AbstractMatrix ,alg:: ColoringAlgorithm = GreedyD1Color ();
@@ -113,31 +113,31 @@ The first argument is the abstract matrix which represents the sparsity pattern
113
113
of the Jacobian. The second argument is the optional choice of coloring algorithm.
114
114
It will default to a greedy distance 1 coloring, though if your special matrix
115
115
type has more information, like is a ` Tridiagonal ` or ` BlockBandedMatrix ` , the
116
- color vector will be analytically calculated instead. The keyword argument
116
+ colorvec vector will be analytically calculated instead. The keyword argument
117
117
` partition_by_rows ` allows you to partition the Jacobian on the basis of rows instead
118
118
of columns and generate a corresponding coloring vector which can be used for
119
119
reverse-mode AD. Default value is false.
120
120
121
- The result is a vector which assigns a color to each column (or row) of the matrix.
121
+ The result is a vector which assigns a colorvec to each column (or row) of the matrix.
122
122
123
- ### Color -Assisted Differentiation
123
+ ### Colorvec -Assisted Differentiation
124
124
125
- Color -assisted differentiation for numerical differentiation is provided by
125
+ Colorvec -assisted differentiation for numerical differentiation is provided by
126
126
DiffEqDiffTools.jl and for automatic differentiation is provided by
127
127
ForwardDiff.jl.
128
128
129
- For DiffEqDiffTools.jl, one simply has to use the provided ` color ` keyword
129
+ For DiffEqDiffTools.jl, one simply has to use the provided ` colorvec ` keyword
130
130
argument. See [ the DiffEqDiffTools Jacobian documentation] ( https://github.com/JuliaDiffEq/DiffEqDiffTools.jl#jacobians ) for more details.
131
131
132
- For forward-mode automatic differentiation, use of a color vector is provided
132
+ For forward-mode automatic differentiation, use of a colorvec vector is provided
133
133
by the following function:
134
134
135
135
``` julia
136
136
forwarddiff_color_jacobian! (J:: AbstractMatrix{<:Number} ,
137
137
f,
138
138
x:: AbstractArray{<:Number} ;
139
139
dx = nothing ,
140
- color = eachindex (x),
140
+ colorvec = eachindex (x),
141
141
sparsity = nothing )
142
142
```
143
143
@@ -147,7 +147,7 @@ cache, construct the cache in advance:
147
147
``` julia
148
148
ForwardColorJacCache (f,x,_chunksize = nothing ;
149
149
dx = nothing ,
150
- color = 1 : length (x),
150
+ colorvec = 1 : length (x),
151
151
sparsity = nothing )
152
152
```
153
153
0 commit comments