Skip to content

Commit 247d599

Browse files
Update for precs changes
1 parent 24cbe4a commit 247d599

File tree

1 file changed

+45
-28
lines changed

1 file changed

+45
-28
lines changed

src/algorithms.jl

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ abstract type StochasticDiffEqRODEAlgorithm <: AbstractRODEAlgorithm end
66
abstract type StochasticDiffEqRODEAdaptiveAlgorithm <: StochasticDiffEqRODEAlgorithm end
77
abstract type StochasticDiffEqRODECompositeAlgorithm <: StochasticDiffEqRODEAlgorithm end
88

9-
abstract type StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller} <: StochasticDiffEqAdaptiveAlgorithm end
10-
abstract type StochasticDiffEqNewtonAlgorithm{CS,AD,FDT,ST,Controller} <: StochasticDiffEqAlgorithm end
9+
abstract type StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller} <: StochasticDiffEqAdaptiveAlgorithm end
10+
abstract type StochasticDiffEqNewtonAlgorithm{CS,AD,FDT,ST,CJ,Controller} <: StochasticDiffEqAlgorithm end
1111

1212
abstract type StochasticDiffEqJumpAlgorithm <: StochasticDiffEqAlgorithm end
1313
abstract type StochasticDiffEqJumpAdaptiveAlgorithm <: StochasticDiffEqAlgorithm end
14-
abstract type StochasticDiffEqJumpNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller} <: StochasticDiffEqJumpAdaptiveAlgorithm end
14+
abstract type StochasticDiffEqJumpNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller} <: StochasticDiffEqJumpAdaptiveAlgorithm end
1515

1616
abstract type StochasticDiffEqJumpDiffusionAlgorithm <: StochasticDiffEqAlgorithm end
1717
abstract type StochasticDiffEqJumpDiffusionAdaptiveAlgorithm <: StochasticDiffEqAlgorithm end
18-
abstract type StochasticDiffEqJumpNewtonDiffusionAdaptiveAlgorithm{CS,AD,FDT,ST,Controller} <: StochasticDiffEqJumpDiffusionAdaptiveAlgorithm end
18+
abstract type StochasticDiffEqJumpNewtonDiffusionAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller} <: StochasticDiffEqJumpDiffusionAdaptiveAlgorithm end
1919

2020
abstract type IteratedIntegralApprox end
2121
struct IICommutative <: IteratedIntegralApprox end
@@ -625,26 +625,29 @@ This is a theta method which defaults to theta=1 or the Trapezoid method on the
625625
This method defaults to symplectic=false, but when true and theta=1/2 this is the implicit Midpoint method on the drift term and is symplectic in distribution.
626626
Can handle all forms of noise, including non-diagonal, scalar, and colored noise. Uses a 1.0/1.5 heuristic for adaptive time stepping.
627627
"""
628-
struct ImplicitEM{CS,AD,F,F2,FDT,ST,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller}
628+
struct ImplicitEM{CS,AD,F,F2,P,FDT,ST,CJ,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller}
629629
linsolve::F
630630
nlsolve::F2
631+
precs::P
631632
theta::T2
632633
extrapolant::Symbol
633634
new_jac_conv_bound::T2
634635
symplectic::Bool
635636
end
636637
ImplicitEM(;chunk_size=0,autodiff=true,diff_type=Val{:central},
637-
standardtag = Val{true}(),
638+
standardtag = Val{true}(),concrete_jac = Val{true}(),
639+
precs = OrdinaryDiffEq.DEFAULT_PRECS,
638640
linsolve=nothing,nlsolve=NLNewton(),
639641
extrapolant=:constant,
640642
theta = 1,symplectic=false,
641643
new_jac_conv_bound = 1e-3,
642644
controller = :Predictive) =
643645
ImplicitEM{chunk_size,autodiff,
644-
typeof(linsolve),typeof(nlsolve),diff_type,
646+
typeof(linsolve),typeof(nlsolve),typeof(precs),diff_type,
645647
OrdinaryDiffEq._unwrap_val(standardtag),
648+
OrdinaryDiffEq._unwrap_val(concrete_jac),
646649
typeof(new_jac_conv_bound),controller}(
647-
linsolve,nlsolve,
650+
linsolve,nlsolve,precs,
648651
symplectic ? 1/2 : theta,
649652
extrapolant,new_jac_conv_bound,symplectic)
650653

@@ -657,27 +660,30 @@ This is a theta method which defaults to theta=1/2 or the Trapezoid method on th
657660
This method defaults to symplectic=false, but when true and theta=1 this is the implicit Midpoint method on the drift term and is symplectic in distribution.
658661
Can handle all forms of noise, including non-diagonal, scalar, and colored noise. Uses a 1.0/1.5 heuristic for adaptive time stepping.
659662
"""
660-
struct ImplicitEulerHeun{CS,AD,F,FDT,ST,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller}
663+
struct ImplicitEulerHeun{CS,AD,F,P,FDT,ST,CJ,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller}
661664
linsolve::F
662665
nlsolve::N
666+
precs::P
663667
theta::T2
664668
extrapolant::Symbol
665669
new_jac_conv_bound::T2
666670
symplectic::Bool
667671
end
668672
ImplicitEulerHeun(;chunk_size=0,autodiff=true,diff_type=Val{:central},
669-
standardtag = Val{true}(),
673+
standardtag = Val{true}(),concrete_jac = Val{true}(),
674+
precs = OrdinaryDiffEq.DEFAULT_PRECS,
670675
linsolve=nothing,nlsolve=NLNewton(),
671676
extrapolant=:constant,
672677
theta = 1,symplectic = false,
673678
new_jac_conv_bound = 1e-3,
674679
controller = :Predictive) =
675680
ImplicitEulerHeun{chunk_size,autodiff,
676-
typeof(linsolve),diff_type,
681+
typeof(linsolve),typeof(precs),diff_type,
677682
OrdinaryDiffEq._unwrap_val(standardtag),
683+
OrdinaryDiffEq._unwrap_val(concrete_jac),
678684
typeof(nlsolve),
679685
typeof(new_jac_conv_bound),controller}(
680-
linsolve,nlsolve,
686+
linsolve,nlsolve,precs,
681687
symplectic ? 1/2 : theta,
682688
extrapolant,
683689
new_jac_conv_bound,symplectic)
@@ -690,16 +696,18 @@ Defaults to solving the Ito problem, but ImplicitRKMil(interpretation=:Stratonov
690696
This method defaults to symplectic=false, but when true and theta=1/2 this is the implicit Midpoint method on the drift term and is symplectic in distribution.
691697
Handles diagonal and scalar noise. Uses a 1.5/2.0 heuristic for adaptive time stepping.
692698
"""
693-
struct ImplicitRKMil{CS,AD,F,FDT,ST,N,T2,Controller,interpretation} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller}
699+
struct ImplicitRKMil{CS,AD,F,P,FDT,ST,CJ,N,T2,Controller,interpretation} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller}
694700
linsolve::F
695701
nlsolve::N
702+
precs::P
696703
theta::T2
697704
extrapolant::Symbol
698705
new_jac_conv_bound::T2
699706
symplectic::Bool
700707
end
701708
ImplicitRKMil(;chunk_size=0,autodiff=true,diff_type=Val{:central},
702-
standardtag = Val{true}(),
709+
standardtag = Val{true}(),concrete_jac = Val{true}(),
710+
precs = OrdinaryDiffEq.DEFAULT_PRECS,
703711
linsolve=nothing,nlsolve=NLNewton(),
704712
extrapolant=:constant,
705713
theta = 1,symplectic = false,
@@ -708,9 +716,10 @@ ImplicitRKMil(;chunk_size=0,autodiff=true,diff_type=Val{:central},
708716
ImplicitRKMil{chunk_size,autodiff,
709717
typeof(linsolve),diff_type,
710718
OrdinaryDiffEq._unwrap_val(standardtag),
719+
OrdinaryDiffEq._unwrap_val(concrete_jac),
711720
typeof(nlsolve),typeof(new_jac_conv_bound),
712721
controller,interpretation}(
713-
linsolve,nlsolve,
722+
linsolve,nlsolve,precs,
714723
symplectic ? 1/2 : theta,
715724
extrapolant,
716725
new_jac_conv_bound,symplectic)
@@ -722,27 +731,30 @@ This is a theta method which defaults to theta=1 or the Trapezoid method on the
722731
This method defaults to symplectic=false, but when true and theta=1/2 this is the implicit Midpoint method on the drift term and is symplectic in distribution.
723732
Can handle all forms of noise, including non-diagonal, scalar, and colored noise. Uses a 1.0/1.5 heuristic for adaptive time stepping.
724733
"""
725-
struct ISSEM{CS,AD,F,FDT,ST,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller}
734+
struct ISSEM{CS,AD,F,P,FDT,ST,CJ,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller}
726735
linsolve::F
727736
nlsolve::N
737+
precs::P
728738
theta::T2
729739
extrapolant::Symbol
730740
new_jac_conv_bound::T2
731741
symplectic::Bool
732742
end
733743
ISSEM(;chunk_size=0,autodiff=true,diff_type=Val{:central},
734-
standardtag = Val{true}(),
744+
standardtag = Val{true}(),concrete_jac = Val{true}(),
745+
precs = OrdinaryDiffEq.DEFAULT_PRECS,
735746
linsolve=nothing,nlsolve=NLNewton(),
736747
extrapolant=:constant,
737748
theta = 1,symplectic=false,
738749
new_jac_conv_bound = 1e-3,
739750
controller = :Predictive) =
740751
ISSEM{chunk_size,autodiff,
741-
typeof(linsolve),diff_type,
752+
typeof(linsolve),typeof(precs),diff_type,
742753
OrdinaryDiffEq._unwrap_val(standardtag),
754+
OrdinaryDiffEq._unwrap_val(concrete_jac),
743755
typeof(nlsolve),
744756
typeof(new_jac_conv_bound),controller}(
745-
linsolve,nlsolve,
757+
linsolve,nlsolve,precs,
746758
symplectic ? 1/2 : theta,
747759
extrapolant,
748760
new_jac_conv_bound,symplectic)
@@ -754,26 +766,29 @@ This is a theta method which defaults to theta=1 or the Trapezoid method on the
754766
This method defaults to symplectic=false, but when true and theta=1/2 this is the implicit Midpoint method on the drift term and is symplectic in distribution.
755767
Can handle all forms of noise, including non-diagonal,Q scalar, and colored noise. Uses a 1.0/1.5 heuristic for adaptive time stepping.
756768
"""
757-
struct ISSEulerHeun{CS,AD,F,FDT,ST,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller}
769+
struct ISSEulerHeun{CS,AD,F,P,FDT,ST,CJ,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller}
758770
linsolve::F
759771
nlsolve::N
772+
precs::P
760773
theta::T2
761774
extrapolant::Symbol
762775
new_jac_conv_bound::T2
763776
symplectic::Bool
764777
end
765778
ISSEulerHeun(;chunk_size=0,autodiff=true,diff_type=Val{:central},
766-
standardtag = Val{true}(),
779+
standardtag = Val{true}(),concrete_jac = Val{true}(),
780+
precs = OrdinaryDiffEq.DEFAULT_PRECS,
767781
linsolve=nothing,nlsolve=NLNewton(),
768782
extrapolant=:constant,
769783
theta = 1,symplectic=false,
770784
new_jac_conv_bound = 1e-3,
771785
controller = :Predictive) =
772786
ISSEulerHeun{chunk_size,autodiff,
773-
typeof(linsolve),diff_type,
787+
typeof(linsolve),typeof(precs),diff_type,
774788
OrdinaryDiffEq._unwrap_val(standardtag),
789+
OrdinaryDiffEq._unwrap_val(concrete_jac),
775790
typeof(nlsolve),typeof(new_jac_conv_bound),controller}(
776-
linsolve,nlsolve,
791+
linsolve,nlsolve,precs,
777792
symplectic ? 1/2 : theta,
778793
extrapolant,
779794
new_jac_conv_bound,symplectic)
@@ -782,25 +797,27 @@ SKenCarp: Stiff Method
782797
Adaptive L-stable drift-implicit strong order 1.5 for additive Ito and Stratonovich SDEs with weak order 2.
783798
Can handle diagonal, non-diagonal and scalar additive noise.
784799
"""
785-
struct SKenCarp{CS,AD,F,FDT,ST,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,Controller}
800+
struct SKenCarp{CS,AD,F,P,FDT,ST,CJ,N,T2,Controller} <: StochasticDiffEqNewtonAdaptiveAlgorithm{CS,AD,FDT,ST,CJ,Controller}
786801
linsolve::F
787802
nlsolve::N
803+
precs::P
788804
smooth_est::Bool
789805
extrapolant::Symbol
790806
new_jac_conv_bound::T2
791807
ode_error_est::Bool
792808
end
793809

794810
SKenCarp(;chunk_size=0,autodiff=true,diff_type=Val{:central},
795-
standardtag = Val{true}(),
811+
standardtag = Val{true}(),concrete_jac = Val{true}(),
812+
precs = OrdinaryDiffEq.DEFAULT_PRECS,
796813
linsolve=nothing,nlsolve=NLNewton(),
797814
smooth_est=true,extrapolant=:min_correct,
798815
new_jac_conv_bound = 1e-3,controller = :Predictive,
799816
ode_error_est = true) =
800-
SKenCarp{chunk_size,autodiff,typeof(linsolve),diff_type,
801-
OrdinaryDiffEq._unwrap_val(standardtag),
817+
SKenCarp{chunk_size,autodiff,typeof(linsolve),typeof(precs),diff_type,
818+
OrdinaryDiffEq._unwrap_val(standardtag),OrdinaryDiffEq._unwrap_val(concrete_jac),
802819
typeof(nlsolve),typeof(new_jac_conv_bound),controller}(
803-
linsolve,nlsolve,smooth_est,extrapolant,new_jac_conv_bound,
820+
linsolve,nlsolve,precs,smooth_est,extrapolant,new_jac_conv_bound,
804821
ode_error_est)
805822

806823

0 commit comments

Comments
 (0)