Added the cache, and fixed a resultant bug in irfftn and irfft2 destroying the input for bigger s.