@@ -177,10 +177,11 @@ Base.parent(vec::VectorOfArray) = vec.u
177
177
# ### 2-argument
178
178
179
179
# first element representative
180
- function DiffEqArray (vec:: AbstractVector , ts:: AbstractVector ; discretes = nothing , variables = nothing , parameters = nothing , independent_variables = nothing )
180
+ function DiffEqArray (vec:: AbstractVector , ts:: AbstractVector ; discretes = nothing ,
181
+ variables = nothing , parameters = nothing , independent_variables = nothing )
181
182
sys = SymbolCache (something (variables, []),
182
- something (parameters, []),
183
- something (independent_variables, []))
183
+ something (parameters, []),
184
+ something (independent_variables, []))
184
185
_size = size (vec[1 ])
185
186
T = eltype (vec[1 ])
186
187
return DiffEqArray{
@@ -199,10 +200,12 @@ function DiffEqArray(vec::AbstractVector, ts::AbstractVector; discretes = nothin
199
200
end
200
201
201
202
# T and N from type
202
- function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector ; discretes = nothing , variables = nothing , parameters = nothing , independent_variables = nothing ) where {T, N, VT <: AbstractArray{T, N} }
203
+ function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector ;
204
+ discretes = nothing , variables = nothing , parameters = nothing ,
205
+ independent_variables = nothing ) where {T, N, VT <: AbstractArray{T, N} }
203
206
sys = SymbolCache (something (variables, []),
204
- something (parameters, []),
205
- something (independent_variables, []))
207
+ something (parameters, []),
208
+ something (independent_variables, []))
206
209
return DiffEqArray{
207
210
eltype (eltype (vec)),
208
211
N + 1 ,
221
224
# ### 3-argument
222
225
223
226
# NTuple, T from type
224
- function DiffEqArray (vec:: AbstractVector{T} , ts:: AbstractVector , :: NTuple{N, Int} ; discretes = nothing ) where {T, N}
227
+ function DiffEqArray (vec:: AbstractVector{T} , ts:: AbstractVector ,
228
+ :: NTuple{N, Int} ; discretes = nothing ) where {T, N}
225
229
DiffEqArray{
226
230
eltype (T), N, typeof (vec), typeof (ts), Nothing, Nothing, typeof (discretes)}(
227
231
vec,
@@ -232,19 +236,23 @@ function DiffEqArray(vec::AbstractVector{T}, ts::AbstractVector, ::NTuple{N, Int
232
236
end
233
237
234
238
# NTuple parameter
235
- function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p:: NTuple{N2, Int} ; discretes = nothing ) where {T, N, VT <: AbstractArray{T, N} , N2}
236
- DiffEqArray {eltype(T), N + 1, typeof(vec), typeof(ts), typeof(p), Nothing, typeof(discretes)} (vec,
239
+ function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p:: NTuple{N2, Int} ;
240
+ discretes = nothing ) where {T, N, VT <: AbstractArray{T, N} , N2}
241
+ DiffEqArray{
242
+ eltype (T), N + 1 , typeof (vec), typeof (ts), typeof (p), Nothing, typeof (discretes)}(
243
+ vec,
237
244
ts,
238
245
p,
239
246
nothing ,
240
247
discretes)
241
248
end
242
249
243
250
# first element representative
244
- function DiffEqArray (vec:: AbstractVector , ts:: AbstractVector , p; discretes = nothing , variables = nothing , parameters = nothing , independent_variables = nothing )
251
+ function DiffEqArray (vec:: AbstractVector , ts:: AbstractVector , p; discretes = nothing ,
252
+ variables = nothing , parameters = nothing , independent_variables = nothing )
245
253
sys = SymbolCache (something (variables, []),
246
- something (parameters, []),
247
- something (independent_variables, []))
254
+ something (parameters, []),
255
+ something (independent_variables, []))
248
256
_size = size (vec[1 ])
249
257
T = eltype (vec[1 ])
250
258
return DiffEqArray{
@@ -263,11 +271,14 @@ function DiffEqArray(vec::AbstractVector, ts::AbstractVector, p; discretes = not
263
271
end
264
272
265
273
# T and N from type
266
- function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p; discretes = nothing , variables = nothing , parameters = nothing , independent_variables = nothing ) where {T, N, VT <: AbstractArray{T, N} }
274
+ function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p;
275
+ discretes = nothing , variables = nothing , parameters = nothing ,
276
+ independent_variables = nothing ) where {T, N, VT <: AbstractArray{T, N} }
267
277
sys = SymbolCache (something (variables, []),
268
- something (parameters, []),
269
- something (independent_variables, []))
270
- DiffEqArray {eltype(T), N + 1, typeof(vec), typeof(ts), typeof(p), typeof(sys), typeof(discretes)} (vec,
278
+ something (parameters, []),
279
+ something (independent_variables, []))
280
+ DiffEqArray{eltype (T), N + 1 , typeof (vec), typeof (ts),
281
+ typeof (p), typeof (sys), typeof (discretes)}(vec,
271
282
ts,
272
283
p,
273
284
sys,
277
288
# ### 4-argument
278
289
279
290
# NTuple, T from type
280
- function DiffEqArray (vec:: AbstractVector{T} , ts:: AbstractVector , :: NTuple{N, Int} , p; discretes = nothing ) where {T, N}
291
+ function DiffEqArray (vec:: AbstractVector{T} , ts:: AbstractVector ,
292
+ :: NTuple{N, Int} , p; discretes = nothing ) where {T, N}
281
293
DiffEqArray{
282
294
eltype (T), N, typeof (vec), typeof (ts), typeof (p), Nothing, typeof (discretes)}(
283
295
vec,
@@ -288,8 +300,10 @@ function DiffEqArray(vec::AbstractVector{T}, ts::AbstractVector, ::NTuple{N, Int
288
300
end
289
301
290
302
# NTuple parameter
291
- function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p:: NTuple{N2, Int} , sys; discretes = nothing ) where {T, N, VT <: AbstractArray{T, N} , N2}
292
- DiffEqArray {eltype(T), N + 1, typeof(vec), typeof(ts), typeof(p), typeof(sys), typeof(discretes)} (vec,
303
+ function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p:: NTuple{N2, Int} , sys;
304
+ discretes = nothing ) where {T, N, VT <: AbstractArray{T, N} , N2}
305
+ DiffEqArray{eltype (T), N + 1 , typeof (vec), typeof (ts),
306
+ typeof (p), typeof (sys), typeof (discretes)}(vec,
293
307
ts,
294
308
p,
295
309
sys,
@@ -316,8 +330,10 @@ function DiffEqArray(vec::AbstractVector, ts::AbstractVector, p, sys; discretes
316
330
end
317
331
318
332
# T and N from type
319
- function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p, sys; discretes = nothing ) where {T, N, VT <: AbstractArray{T, N} }
320
- DiffEqArray {eltype(T), N + 1, typeof(vec), typeof(ts), typeof(p), typeof(sys), typeof(discretes)} (vec,
333
+ function DiffEqArray (vec:: AbstractVector{VT} , ts:: AbstractVector , p, sys;
334
+ discretes = nothing ) where {T, N, VT <: AbstractArray{T, N} }
335
+ DiffEqArray{eltype (T), N + 1 , typeof (vec), typeof (ts),
336
+ typeof (p), typeof (sys), typeof (discretes)}(vec,
321
337
ts,
322
338
p,
323
339
sys,
327
343
# ### 5-argument
328
344
329
345
# NTuple, T from type
330
- function DiffEqArray (vec:: AbstractVector{T} , ts:: AbstractVector , :: NTuple{N, Int} , p, sys; discretes = nothing ) where {T, N}
346
+ function DiffEqArray (vec:: AbstractVector{T} , ts:: AbstractVector ,
347
+ :: NTuple{N, Int} , p, sys; discretes = nothing ) where {T, N}
331
348
DiffEqArray{
332
349
eltype (T), N, typeof (vec), typeof (ts), typeof (p), typeof (sys), typeof (discretes)}(
333
350
vec,
942
959
VectorOfArray (rewrap (parent, u))
943
960
end
944
961
945
- rewrap (:: Array ,u) = u
962
+ rewrap (:: Array , u) = u
946
963
rewrap (parent, u) = convert (typeof (parent), u)
947
964
948
965
for (type, N_expr) in [
0 commit comments