You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the case that the step size in the abscissa is constant, the following zero_hold interpolant is some 150 times faster than ZeroSpline -- on a test case. However, I'm no super coder, so my code uses some 7 times more memory on my test case.
functionzero_hold(x,dx,y)
if x <0return y[1]
elseif x >=length(y)*dx
return y[end]
elsereturn y[trunc(Int,x/dx)+1]
endend
The added speed is important (my test case is not that important -- I used a simple sinus function). But because of added memory use, in practice my code is slower when used in an ODE solver (due to garbage collection).
Would it be possible to extend the ZeroSpline interpolant to allow for constant abscissa step? With your coding expertise -- can you make it memory efficient, too? That would be super!
The text was updated successfully, but these errors were encountered:
It would just need to specialize on range types so that way its find function is faster. That should be pretty straightforward to do just through dispatch, without actually changing most of the package.
For the case that the step size in the abscissa is constant, the following
zero_hold
interpolant is some 150 times faster thanZeroSpline
-- on a test case. However, I'm no super coder, so my code uses some 7 times more memory on my test case.The added speed is important (my test case is not that important -- I used a simple sinus function). But because of added memory use, in practice my code is slower when used in an ODE solver (due to garbage collection).
Would it be possible to extend the
ZeroSpline
interpolant to allow for constant abscissa step? With your coding expertise -- can you make it memory efficient, too? That would be super!The text was updated successfully, but these errors were encountered: