Created
January 29, 2011 14:46
-
-
Save axman6/801883 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fft :: [[Integer]] -> [Integer] -> Integer -> Integer -> Integer -> Integer | |
fft as rho m mM sig pc = ... cooleyTukey bs (rhoMult m mM) (mM `div` mM) ... | |
where Ibs = zipWith (badMult m mM sig pc) pr as | |
pr = powersOfRho (m * 2) rho m mM sig pc | |
data Constants = C { mM :: Integer, sig :: Integer, pc :: Integer} | |
fft :: [[Integer]] -> [Integer] -> Integer -> Integer -> Integer -> Integer | |
fft as rho m mM sig pc = runReader fft' (Constants mM sig pc) | |
fft' = do | |
pr <- powersOfRho | |
uibd <- zipWithM badMult pr as | |
return (cooleyTukey ...) | |
badMult :: Reader Integer | |
badMult = do | |
m' <- asks m | |
<ask for any more values you need to return> | |
... | |
let x = <result of computation that used to be badMult> | |
return x | |
powersOfRho :: Reader [Integer] | |
powersOfRho = do | |
m' <- asks m | |
rho' <- asks rho | |
... | |
let x = <computation that used to be in powersOfRho> | |
return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment