@@ -289,11 +289,6 @@ the usage of `f`. These include:
289
289
based on the sparsity pattern. Defaults to `nothing`, which means a color vector will be
290
290
internally computed on demand when required. The cost of this operation is highly dependent
291
291
on the sparsity pattern.
292
- - `nlprob`: a `NonlinearProblem` that solves `f(u, t, p) = u_tmp`
293
- where the nonlinear parameters are the tuple `(t, u_tmp, p)`.
294
- This will be used as the nonlinear problem inside an implicit solver by specifying `u, u_tmp` and `t`
295
- such that solving this function produces a solution to the implicit step of your solver.
296
-
297
292
## iip: In-Place vs Out-Of-Place
298
293
299
294
`iip` is the optional boolean for determining whether a given function is written to
@@ -406,7 +401,7 @@ numerically-defined functions.
406
401
"""
407
402
struct ODEFunction{iip, specialize, F, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TWt, WP, TPJ,
408
403
O, TCV,
409
- SYS, ID, NLP} <: AbstractODEFunction{iip}
404
+ SYS, ID<: Union{Nothing, OverrideInitData} , NLP<: Union{Nothing, ODE_NLProbData} } <: AbstractODEFunction{iip}
410
405
f:: F
411
406
mass_matrix:: TMM
412
407
analytic:: Ta
@@ -424,7 +419,7 @@ struct ODEFunction{iip, specialize, F, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TW
424
419
colorvec:: TCV
425
420
sys:: SYS
426
421
initialization_data:: ID
427
- nlprob :: NLP
422
+ nlprob_data :: NLP
428
423
end
429
424
430
425
@doc doc"""
@@ -527,8 +522,7 @@ information on generating the SplitFunction from this symbolic engine.
527
522
"""
528
523
struct SplitFunction{
529
524
iip, specialize, F1, F2, TMM, C, Ta, Tt, TJ, JVP, VJP, JP, WP, SP, TW, TWt,
530
- TPJ, O,
531
- TCV, SYS, ID, NLP} <: AbstractODEFunction{iip}
525
+ TPJ, O, TCV, SYS, ID<: Union{Nothing, OverrideInitData} , NLP<: Union{Nothing, ODE_NLProbData} } <: AbstractODEFunction{iip}
532
526
f1:: F1
533
527
f2:: F2
534
528
mass_matrix:: TMM
@@ -547,8 +541,8 @@ struct SplitFunction{
547
541
observed:: O
548
542
colorvec:: TCV
549
543
sys:: SYS
550
- nlprob:: NLP
551
544
initialization_data:: ID
545
+ nlprob_data:: NLP
552
546
end
553
547
554
548
@doc doc"""
@@ -2446,9 +2440,9 @@ function ODEFunction{iip, specialize}(f;
2446
2440
f. update_initializeprob! : nothing ,
2447
2441
initializeprobmap = __has_initializeprobmap (f) ? f. initializeprobmap : nothing ,
2448
2442
initializeprobpmap = __has_initializeprobpmap (f) ? f. initializeprobpmap : nothing ,
2449
- nlprob = __has_nlprob (f) ? f. nlprob : nothing ,
2450
2443
initialization_data = __has_initialization_data (f) ? f. initialization_data :
2451
- nothing
2444
+ nothing ,
2445
+ nlprob_data = __has_nlprob_data (f) ? f. nlprob_data : nothing ,
2452
2446
) where {iip,
2453
2447
specialize
2454
2448
}
@@ -2506,10 +2500,10 @@ function ODEFunction{iip, specialize}(f;
2506
2500
typeof (sparsity), Any, Any, typeof (W_prototype), Any,
2507
2501
Any,
2508
2502
typeof (_colorvec),
2509
- typeof (sys), Any, Any }(_f, mass_matrix, analytic, tgrad, jac,
2503
+ typeof (sys), Union{Nothing, OverrideInitData}, Union{Nothing, ODE_NLProbData} }(_f, mass_matrix, analytic, tgrad, jac,
2510
2504
jvp, vjp, jac_prototype, sparsity, Wfact,
2511
2505
Wfact_t, W_prototype, paramjac,
2512
- observed, _colorvec, sys, initdata, nlprob )
2506
+ observed, _colorvec, sys, initdata, nlprob_data )
2513
2507
elseif specialize === false
2514
2508
ODEFunction{iip, FunctionWrapperSpecialize,
2515
2509
typeof (_f), typeof (mass_matrix), typeof (analytic), typeof (tgrad),
@@ -2518,11 +2512,11 @@ function ODEFunction{iip, specialize}(f;
2518
2512
typeof (paramjac),
2519
2513
typeof (observed),
2520
2514
typeof (_colorvec),
2521
- typeof (sys), typeof (initdata), typeof (nlprob )}(_f, mass_matrix,
2515
+ typeof (sys), typeof (initdata), typeof (nlprob_data )}(_f, mass_matrix,
2522
2516
analytic, tgrad, jac,
2523
2517
jvp, vjp, jac_prototype, sparsity, Wfact,
2524
2518
Wfact_t, W_prototype, paramjac,
2525
- observed, _colorvec, sys, initdata, nlprob )
2519
+ observed, _colorvec, sys, initdata, nlprob_data )
2526
2520
else
2527
2521
ODEFunction{iip, specialize,
2528
2522
typeof (_f), typeof (mass_matrix), typeof (analytic), typeof (tgrad),
@@ -2531,11 +2525,11 @@ function ODEFunction{iip, specialize}(f;
2531
2525
typeof (paramjac),
2532
2526
typeof (observed),
2533
2527
typeof (_colorvec),
2534
- typeof (sys), typeof (initdata), typeof (nlprob )}(
2528
+ typeof (sys), typeof (initdata), typeof (nlprob_data )}(
2535
2529
_f, mass_matrix, analytic, tgrad,
2536
2530
jac, jvp, vjp, jac_prototype, sparsity, Wfact,
2537
2531
Wfact_t, W_prototype, paramjac,
2538
- observed, _colorvec, sys, initdata, nlprob )
2532
+ observed, _colorvec, sys, initdata, nlprob_data )
2539
2533
end
2540
2534
end
2541
2535
@@ -2552,23 +2546,23 @@ function unwrapped_f(f::ODEFunction, newf = unwrapped_f(f.f))
2552
2546
Any, Any, Any, Any, typeof (f. jac_prototype),
2553
2547
typeof (f. sparsity), Any, Any, Any,
2554
2548
Any, typeof (f. colorvec),
2555
- typeof (f. sys), Any, Any }(
2549
+ typeof (f. sys), Union{Nothing, OverrideInitData}, Union{Nothing, ODE_NLProbData} }(
2556
2550
newf, f. mass_matrix, f. analytic, f. tgrad, f. jac,
2557
2551
f. jvp, f. vjp, f. jac_prototype, f. sparsity, f. Wfact,
2558
2552
f. Wfact_t, f. W_prototype, f. paramjac,
2559
- f. observed, f. colorvec, f. sys, f. initialization_data, f. nlprob )
2553
+ f. observed, f. colorvec, f. sys, f. initialization_data, f. nlprob_data )
2560
2554
else
2561
2555
ODEFunction{isinplace (f), specialization (f), typeof (newf), typeof (f. mass_matrix),
2562
2556
typeof (f. analytic), typeof (f. tgrad),
2563
2557
typeof (f. jac), typeof (f. jvp), typeof (f. vjp), typeof (f. jac_prototype),
2564
2558
typeof (f. sparsity), typeof (f. Wfact), typeof (f. Wfact_t), typeof (f. W_prototype),
2565
2559
typeof (f. paramjac),
2566
2560
typeof (f. observed), typeof (f. colorvec),
2567
- typeof (f. sys), typeof (f. initialization_data), typeof (f. nlprob )}(
2561
+ typeof (f. sys), typeof (f. initialization_data), typeof (f. nlprob_data )}(
2568
2562
newf, f. mass_matrix, f. analytic, f. tgrad, f. jac,
2569
2563
f. jvp, f. vjp, f. jac_prototype, f. sparsity, f. Wfact,
2570
2564
f. Wfact_t, f. W_prototype, f. paramjac,
2571
- f. observed, f. colorvec, f. sys, f. initialization_data, f. nlprob )
2565
+ f. observed, f. colorvec, f. sys, f. initialization_data, f. nlprob_data )
2572
2566
end
2573
2567
end
2574
2568
@@ -2703,7 +2697,7 @@ end
2703
2697
@add_kwonly function SplitFunction (f1, f2, mass_matrix, cache, analytic, tgrad, jac, jvp,
2704
2698
vjp, jac_prototype, W_prototype, sparsity, Wfact, Wfact_t, paramjac,
2705
2699
observed, colorvec, sys, initializeprob = nothing , update_initializeprob! = nothing ,
2706
- initializeprobmap = nothing , initializeprobpmap = nothing , nlprob = nothing , initialization_data = nothing )
2700
+ initializeprobmap = nothing , initializeprobpmap = nothing , initialization_data = nothing , nlprob_data = nothing )
2707
2701
f1 = ODEFunction (f1)
2708
2702
f2 = ODEFunction (f2)
2709
2703
@@ -2721,11 +2715,11 @@ end
2721
2715
typeof (cache), typeof (analytic), typeof (tgrad), typeof (jac), typeof (jvp),
2722
2716
typeof (vjp), typeof (jac_prototype), typeof (W_prototype), typeof (sparsity),
2723
2717
typeof (Wfact), typeof (Wfact_t), typeof (paramjac), typeof (observed), typeof (colorvec),
2724
- typeof (sys), typeof (initdata), typeof (nlprob )}(
2718
+ typeof (sys), typeof (initdata), typeof (nlprob_data )}(
2725
2719
f1, f2, mass_matrix,
2726
2720
cache, analytic, tgrad, jac, jvp, vjp,
2727
2721
jac_prototype, W_prototype, sparsity, Wfact, Wfact_t, paramjac, observed, colorvec, sys,
2728
- initdata, nlprob )
2722
+ initdata, nlprob_data )
2729
2723
end
2730
2724
function SplitFunction {iip, specialize} (f1, f2;
2731
2725
mass_matrix = __has_mass_matrix (f1) ?
@@ -2762,7 +2756,7 @@ function SplitFunction{iip, specialize}(f1, f2;
2762
2756
f1. update_initializeprob! : nothing ,
2763
2757
initializeprobmap = __has_initializeprobmap (f1) ? f1. initializeprobmap : nothing ,
2764
2758
initializeprobpmap = __has_initializeprobpmap (f1) ? f1. initializeprobpmap : nothing ,
2765
- nlprob = __has_nlprob (f1) ? f1. nlprob : nothing ,
2759
+ nlprob_data = __has_nlprob_data (f1) ? f1. nlprob_data : nothing ,
2766
2760
initialization_data = __has_initialization_data (f1) ? f1. initialization_data :
2767
2761
nothing
2768
2762
) where {iip,
@@ -2776,23 +2770,23 @@ function SplitFunction{iip, specialize}(f1, f2;
2776
2770
if specialize === NoSpecialize
2777
2771
SplitFunction{iip, specialize, Any, Any, Any, Any, Any, Any, Any, Any, Any,
2778
2772
Any, Any, Any, Any, Any, Any, Any,
2779
- Any, Any, Any, Any }(f1, f2, mass_matrix, _func_cache,
2773
+ Any, Any, Union{Nothing, OverrideInitData}, Union{Nothing, ODE_NLProbData} }(f1, f2, mass_matrix, _func_cache,
2780
2774
analytic,
2781
2775
tgrad, jac, jvp, vjp, jac_prototype, W_prototype,
2782
2776
sparsity, Wfact, Wfact_t, paramjac,
2783
- observed, colorvec, sys, initdata, nlprob )
2777
+ observed, colorvec, sys, initdata, nlprob_data )
2784
2778
else
2785
2779
SplitFunction{iip, specialize, typeof (f1), typeof (f2), typeof (mass_matrix),
2786
2780
typeof (_func_cache), typeof (analytic),
2787
2781
typeof (tgrad), typeof (jac), typeof (jvp), typeof (vjp),
2788
2782
typeof (jac_prototype), typeof (W_prototype), typeof (sparsity),
2789
2783
typeof (Wfact), typeof (Wfact_t), typeof (paramjac), typeof (observed),
2790
2784
typeof (colorvec),
2791
- typeof (sys), typeof (initdata), typeof (nlprob )}(f1, f2,
2785
+ typeof (sys), typeof (initdata), typeof (nlprob_data )}(f1, f2,
2792
2786
mass_matrix, _func_cache, analytic, tgrad, jac,
2793
2787
jvp, vjp, jac_prototype, W_prototype,
2794
2788
sparsity, Wfact, Wfact_t, paramjac, observed, colorvec, sys,
2795
- initdata, nlprob )
2789
+ initdata, nlprob_data )
2796
2790
end
2797
2791
end
2798
2792
@@ -4488,7 +4482,7 @@ __has_colorvec(f) = isdefined(f, :colorvec)
4488
4482
__has_sys (f) = isdefined (f, :sys )
4489
4483
__has_analytic_full (f) = isdefined (f, :analytic_full )
4490
4484
__has_resid_prototype (f) = isdefined (f, :resid_prototype )
4491
- __has_nlprob (f) = isdefined (f, :nlprob )
4485
+ __has_nlprob_data (f) = isdefined (f, :nlprob_data )
4492
4486
function __has_initializeprob (f)
4493
4487
has_initialization_data (f) && isdefined (f. initialization_data, :initializeprob )
4494
4488
end
0 commit comments