chebfun/chebfun — pull request #1089 by nickhale (2014-07-27 20:03:13+00:00)
Title: Fix chebtech qr

For speed we persistently store two matrices in CHEBTECH/QR; WP and its inverse. The documentation claims these matrices depend only on the length of the dat, not the dat itself. This is sort of true, but they also depend on the type of CHEBTECH being used. Hence, using a CHEBTECH1 and then a CHEBTECH2 will produce incorrect results.

This commit should fix this. It's not elegant, but the alternatives involve splitting the built-in QR back out the both CHEBTECH1 and CHEBTECH2 (which is a lot of duplication) or take a hit in performance. The docs claim CHEBFUN2 relies heavily on QR for speed, so I'm hesitant to do that either. Instead I propose we live with this tiny bit of ugliness.