JuliaApproximation / ContinuumArrays.jl

A package for representing quasi arrays with continuous indices
MIT License
27 stars 6 forks source link

higher order and partial differentiation syntax #154

Open dlfivefifty opened 1 year ago

dlfivefifty commented 1 year ago

What do people think of

diff(f, order=3) # 3rd derivative
diff(f, order=(1,1)) # partial derivative f_{xy}

Behind the scenes it will wrap in a Val and because of constant propagation this should maintain type-stability..

TSGut commented 1 year ago

Sounds like the natural way to do it given diff(f) syntax, what's the alternative?

dlfivefifty commented 1 year ago

Not sure what alternative...Is order the best name?

TSGut commented 1 year ago

Can't think of a better name than order. I mean you could just do diff(f, 2) but I think that's worse.

dlfivefifty commented 1 year ago

Hmm I kinda like diff(f, 2) and diff(f, (1,1))...

TSGut commented 1 year ago

I think those options are both fine. I don't really have an argument for why one is better than the other (my preference is basically just aesthetic) and can't think of a third option that doesn't feel forced.