SciML / ExponentialUtilities.jl

Fast and differentiable implementations of matrix exponentials, Krylov exponential matrix-vector multiplications ("expmv"), KIOPS, ExpoKit functions, and more. All your exponential needs in SciML form.
https://docs.sciml.ai/ExponentialUtilities/stable/
Other
96 stars 31 forks source link

don't use generated function implimentation of naivemul for sparse matrices #175

Closed oscardssmith closed 5 months ago

oscardssmith commented 5 months ago

I'm in general pretty skeptical of the naivemul introduced in https://github.com/SciML/ExponentialUtilities.jl/pull/57, but this at least makes it dramatically better for sparse matrices. This improves, but does not fix https://github.com/SciML/OrdinaryDiffEq.jl/issues/2121.

# before
julia> @time exponential!(sprand(500,500,.001), ExpMethodGeneric());
  9.914123 seconds (52 allocations: 13.983 MiB)

#after
@time exponential!(sprand(500,500,.001), ExpMethodGeneric());
  2.100566 seconds (260 allocations: 14.785 MiB)