dlfivefifty/ApproxFun.jl — pull request #36 by MikaelSlevinsky (2014-10-30 12:28:35+00:00)
Title: JacobiWeightSpace sum and getindex override for Derivative

To generalize the Base.sum override for all JacobiWeightSpace parameters, Sister Celine's technique is used to evaluate the hypergeometric series resulting from integrating Chebyshev polynomials with Jacobi weights.

For the Derivative's getindex, this will allow one to solve
Lu + M(g(x)u) = f,
where L and M are linear differential operators and g(x) is a Fun. Simple comparison would be as follows:

x = Fun(identity)
d = domain(x)
D = diff(d)
B = dirichlet(d)
L1 = D*(2*x+(1+x^2)*D)
u1 = [B,L1]\[-1.,1.]

whereas this could be simplified:

L2 = (D^2)[1+x^2]
u2 = [B,L2]\[-1.,1.]
u1 == u2

I don't know how you feel about adding this. This may be confusing to the user: diff(f) differentiates a Fun, but D[f] would create the operator D*f + f*D, and D*f returns a Fun in a promoted space. I didn't see a way around this, though, given that the linear operator's syntax doesn't accept a "u" argument.

As a head's up, there seems to be a new Base function introduced in v0.4: call, which allows you to write "call"s even on user-defined types. The difference between call and getindex is () vs. [], so in some instances one may be more natural than the other.