SciML / DiffEqCallbacks.jl

A library of useful callbacks for hybrid scientific machine learning (SciML) with augmented differential equation solvers
https://docs.sciml.ai/DiffEqCallbacks/stable/
Other
85 stars 44 forks source link

fix remaining allocations in `PresetTimeCallback` #218

Closed oscardssmith closed 2 months ago

oscardssmith commented 2 months ago

I was missing a let that was causing tstops to be captured by the condition closure. Fixes https://github.com/SciML/DiffEqCallbacks.jl/issues/217. We now get

julia> @time solve(prob, Tsit5(), callback=callback);
  0.000988 seconds (95 allocations: 44.703 KiB)

where all the additional allocations are in the init stage.