@@ -145,37 +145,7 @@ function __init__()
145
145
end
146
146
147
147
@require Tracker= " 9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" begin
148
- value (x:: Type{Tracker.TrackedReal{T}} ) where T = T
149
- value (x:: Type{Tracker.TrackedArray{T,N,A}} ) where {T,N,A} = Array{T,N}
150
- value (x:: Tracker.TrackedReal ) = x. data
151
- value (x:: Tracker.TrackedArray ) = x. data
152
-
153
- @inline fastpow (x:: Tracker.TrackedReal , y:: Tracker.TrackedReal ) = x^ y
154
- @inline Base. any (f:: Function ,x:: Tracker.TrackedArray ) = any (f,Tracker. data (x))
155
-
156
- # Support adaptive with non-tracked time
157
- @inline function ODE_DEFAULT_NORM (u:: Tracker.TrackedArray ,t) where {N}
158
- sqrt (sum (abs2,value (u)) / length (u))
159
- end
160
- @inline function ODE_DEFAULT_NORM (u:: AbstractArray{<:Tracker.TrackedReal,N} ,t) where {N}
161
- sqrt (sum (x-> ODE_DEFAULT_NORM (x[1 ],x[2 ]),zip ((value (x) for x in u),Iterators. repeated (t))) / length (u))
162
- end
163
- @inline function ODE_DEFAULT_NORM (u:: Array{<:Tracker.TrackedReal,N} ,t) where {N}
164
- sqrt (sum (x-> ODE_DEFAULT_NORM (x[1 ],x[2 ]),zip ((value (x) for x in u),Iterators. repeated (t))) / length (u))
165
- end
166
- @inline ODE_DEFAULT_NORM (u:: Tracker.TrackedReal ,t) = abs (value (u))
167
-
168
- # Support TrackedReal time, don't drop tracking on the adaptivity there
169
- @inline function ODE_DEFAULT_NORM (u:: Tracker.TrackedArray ,t:: Tracker.TrackedReal ) where {N}
170
- sqrt (sum (abs2,u) / length (u))
171
- end
172
- @inline function ODE_DEFAULT_NORM (u:: AbstractArray{<:Tracker.TrackedReal,N} ,t:: Tracker.TrackedReal ) where {N}
173
- sqrt (sum (x-> ODE_DEFAULT_NORM (x[1 ],x[2 ]),zip (u,Iterators. repeated (t))) / length (u))
174
- end
175
- @inline function ODE_DEFAULT_NORM (u:: Array{<:Tracker.TrackedReal,N} ,t:: Tracker.TrackedReal ) where {N}
176
- sqrt (sum (x-> ODE_DEFAULT_NORM (x[1 ],x[2 ]),zip (u,Iterators. repeated (t))) / length (u))
177
- end
178
- @inline ODE_DEFAULT_NORM (u:: Tracker.TrackedReal ,t:: Tracker.TrackedReal ) = abs (u)
148
+ include (" tracker.jl" )
179
149
end
180
150
181
151
# Piracy, should get upstreamed
@@ -213,6 +183,10 @@ function __init__()
213
183
end
214
184
end
215
185
186
+ @require ReverseDiff= " 37e2e3b7-166d-5795-8a7a-e32c996b4267" begin
187
+ include (" reversediff.jl" )
188
+ end
189
+
216
190
@require GeneralizedGenerated= " 6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb" begin
217
191
numargs (:: GeneralizedGenerated.RuntimeFn{Args} ) where Args = GeneralizedGenerated. from_type (Args) |> length
218
192
end
0 commit comments