-
Notifications
You must be signed in to change notification settings - Fork 32
Description
I think this line https://github.com/chebfun/examples/blob/master/sphere/SolidHarmonics.m#L112 was supposed to be the definition of alm. Also, blm has an n, presumably supposed to be l.
Also, the stated complexity https://github.com/chebfun/examples/blob/master/sphere/SolidHarmonics.m#L89, O(l log l), of constructing a regular solid harmonic Rlm as a ballfun should be O(l^2) as determined by the loop https://github.com/chebfun/chebfun/blob/master/%40ballfun/solharm.m#L112 over the O(l) evaluation points https://github.com/chebfun/chebfun/blob/master/%40ballfun/solharm.m#L89, dominating over the additional cost of the FFT.
Actually, this is one application where the algorithm sketched out in chebfun/chebfun#2320 is not only more accurate, being backward stable, but also carries a lower complexity since it would cost only O(lm + l log^2 l): the first part comes from the nested loop of Givens rotations and the second part from the cost of Chebfun's fast polynomial transforms, such as leg2cheb. When m = o(l), this approach should be faster for you.