evaluate orthogonal polynomials
Closed this issue · 2 comments
is it really true that to evaluate what in mathematica would be HermiteH[4,Pi]
I have to type
Fun(Hermite(),[0,0,0,0,1])(π)
any hope of adding a nice calling function? (maybe already there and i missed it in the docs?)
It would be nice to get Hermite()(4, pi)
to work. Currently, there's the unexported
julia> ApproxFunBase.basisfunction(Hermite(), 5)(pi) == Fun(Hermite(),[0,0,0,0,1])(π)
true
which isn't any easier, and also uses the length of the vector as the argument rather than the degree of the polynomial (seems to be an oversight). We can get Hermite()(4, pi)
to call this internally. The advantage of ApproxFunBase.basisfunction
over the Fun
constructor is that it doesn't allocate.
The reason I'd prefer Hermite()(n, x)
over Hermite(n, x)
is that this lets one easily use NormalizedHermite()(n, x)
instead, even though NormalizedHermite
isn't a defined type but is a wrapper around Hermite
. Also, Hermite(n, x)
feels like an abuse of the constructor.
This is why I redesigned in ClassicalOrthogonalPolynomials.jl, where it can be done as hermiteh(4, x)
or Hermite()[x,5]
.