diff --git a/benchmarks/rabi-dormand-prince.jl b/benchmarks/rabi-dormand-prince.jl index 2138ad5..5ad4067 100644 --- a/benchmarks/rabi-dormand-prince.jl +++ b/benchmarks/rabi-dormand-prince.jl @@ -1,5 +1,5 @@ using BenchmarkTools -using DormandPrince:DP5Solver, dp5_integrate +using DormandPrince:DP5Solver, core_integrator function fcn(x, y, f) g(x) = 2.2*2π*sin(2π*x) @@ -14,6 +14,6 @@ solver = DP5Solver( ComplexF64[1.0, 0.0] ) -dp5_integrate(solver, 2π) + core_integrator(solver, 2π) -@benchmark dp5_integrate(clean_solver, 2π) setup=(clean_solver = DP5Solver(fcn, 0.0, ComplexF64[1.0, 0.0])) samples=10000 evals=5 seconds=500 \ No newline at end of file +@benchmark core_integrator(clean_solver, 2π) setup=(clean_solver = DP5Solver(fcn, 0.0, ComplexF64[1.0, 0.0])) samples=10000 evals=5 seconds=500 \ No newline at end of file diff --git a/src/types.jl b/src/types.jl index 9bcaf47..26c2934 100644 --- a/src/types.jl +++ b/src/types.jl @@ -3,7 +3,7 @@ abstract type AbstractDPSolver{T <: Real, StateType <: AbstractVector, F} end @enum Idid begin COMPUTATION_SUCCESSFUL = 1 - INPUT_NOT_CONSISTENT = -1 # use for check failures in the beginning of dp5_integrate call + INPUT_NOT_CONSISTENT = -1 # use for check failures in the beginning of core_integrator call LARGER_NMAX_NEEDED = -2 STEP_SIZE_BECOMES_TOO_SMALL = -3 end @@ -77,7 +77,7 @@ end end -# should "dp5_integrate" take in DP5Solver or should DP5Solver have some associated method +# should " core_integrator" take in DP5Solver or should DP5Solver have some associated method # attached to it? struct DP5Solver{T, StateType ,F} <: AbstractDPSolver{T, StateType, F} f::F diff --git a/test/type_stab.jl b/test/type_stab.jl new file mode 100644 index 0000000..4e9cb27 --- /dev/null +++ b/test/type_stab.jl @@ -0,0 +1,20 @@ +using DormandPrince: DP5Solver, integrate +using JET: @report_opt + + +function fcn(x, y, f) + g(x) = 2.2*2π*sin(2π*x) + + f[1] = -1im * g(x)/2 * y[2] + f[2] = -1im * g(x)/2 * y[1] +end + +solver = DP5Solver( + fcn, + 0.0, + ComplexF64[1.0, 0.0] +) + +@report_opt integrate(solver, 2π) + +