Browse files

Inline wrapper function and give them change to fuse

  • Loading branch information...
1 parent 13c1904 commit 4be5d5c16a04ffb5d630e5b1d897b2fe525c4a93 @Shimuuar Shimuuar committed Sep 14, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 Statistics/Transform.hs
View
4 Statistics/Transform.hs
@@ -43,11 +43,13 @@ type CD = Complex Double
-- | Discrete cosine transform (DCT-II).
dct :: U.Vector Double -> U.Vector Double
+{-# INLINE dct #-}
dct = dctWorker . G.map (:+0)
-- | Discrete cosine transform (DCT-II). Only real part of vector is
-- transformed, imaginary part is ignored.
dct_ :: U.Vector CD -> U.Vector Double
+{-# INLINE dct_ #-}
dct_ = dctWorker . G.map (\(i :+ _) -> i :+ 0)
dctWorker :: U.Vector CD -> U.Vector Double
@@ -68,11 +70,13 @@ dctWorker xs
--
-- > (idct . dct) x = (* length x)
idct :: U.Vector Double -> U.Vector Double
+{-# INLINE idct #-}
idct = idctWorker . G.map (:+0)
-- | Inverse discrete cosine transform (DCT-III). Only real part of vector is
-- transformed, imaginary part is ignored.
idct_ :: U.Vector CD -> U.Vector Double
+{-# INLINE idct_ #-}
idct_ = idctWorker . G.map (\(i :+ _) -> i :+ 0)
idctWorker :: U.Vector CD -> U.Vector Double

0 comments on commit 4be5d5c

Please sign in to comment.