@@ -307,48 +307,37 @@ do2 = inTest "hermit TreeTest.hs -v0 -opt=LambdaCCC.Monomorphize DoTree.hss"
307307-- Only works when compiled with HERMIT
308308main :: IO ()
309309
310- #if 0
311- -------- Dave's FFT stuff ----------------------------------------------
312- -- Phasor, as a function of tree depth.
313- phasor :: (IsNat n , RealFloat a , Enum a ) => Nat n -> RTree n (Complex a )
314- phasor n = scanlTEx (*) 1 (pure phaseDelta)
315- where phaseDelta = cis ((- pi ) / 2 ** natToZ n)
316-
317- -- Radix-2, DIT FFT
318- fft_r2_dit :: (IsNat n , RealFloat a , Enum a ) => RTree n (Complex a ) -> RTree n (Complex a )
319- fft_r2_dit = fft_r2_dit' nat
320-
321- fft_r2_dit' :: (RealFloat a , Enum a ) => Nat n -> RTree n (Complex a ) -> RTree n (Complex a )
322- fft_r2_dit' Zero = id
323- fft_r2_dit' (Succ n) = RT. toB . P. inP (uncurry (+) &&& uncurry (-) ) . P. secondP (liftA2 (*) (phasor n)) . fmap (fft_r2_dit' n) . RT. bottomSplit
324-
325- -- main = go "fft_r2_dit" (fft_r2_dit :: RTree N1 (Complex Int) -> RTree N1 (Complex Int))
326- -- main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Double) -> RTree N2 (Complex Double))
327- -- main = go "fft_r2_dit" (fft_r2_dit :: RTree N1 (Complex PrettyDouble) -> RTree N1 (Complex PrettyDouble))
328- -- main = go "fft_r2_dit" (fft_r2_dit :: RTree N2 (Complex Int) -> RTree N2 (Complex Int))
329- -- main = goSep "fft_r2_dit" 1 (fft_r2_dit :: RTree N1 (Complex Int) -> RTree N1 (Complex Int))
330- -------- End Dave's FFT stuff ------------------------------------------
331- #else
310+ ---- FFT
332311
333312type C = Complex Double
334313
335314-- main = go "foo" ()
336315
337316-- main = go "fft-p" (fft :: Unop (Pair C))
338317
339- -- main = go "fft-lt0" (fft :: LTree N0 C -> RTree N0 C)
340-
341- -- main = go "fft-lt2" (fft :: LTree N2 C -> RTree N2 C)
318+ -- main = go "fft-lt1" (fft :: LTree N1 C -> RTree N1 C)
342319
343320-- main = go "fft-rt1" (fft :: RTree N1 C -> LTree N1 C)
344321
345322-- twiddles :: forall g f a. (AFS g, AFS f, RealFloat a) => g (f (Complex a))
346323
347- -- main = go "twiddles-rt1p" (twiddles :: RTree N1 (Pair C))
324+ -- main = go "twiddles-lt1p" (twiddles :: LTree N1 (Pair C))
325+
326+ -- main = go "foo" (omega (size (undefined :: (LTree N1 :. Pair) ())))
327+
328+ -- twiddles :: forall g f a. (AFS g, AFS f, RealFloat a) => g (f (Complex a))
329+ -- twiddles = powers <$> powers (omega (tySize(g :. f)))
348330
349- main = go " foo" (size ( undefined :: RTree N1 () ) )
331+ main = go " foo" (powers :: Int -> LTree N1 Int )
350332
351- -- main = go "foo" (size (undefined :: (RTree N1 :. Pair) ()))
333+ -- zoop :: Int
334+ -- zoop = 3
335+
336+ -- main = go "foo" zoop
337+
338+ -- main = go "foo" (size (undefined :: RTree N3 ()))
339+
340+ -- main = go "foo" (size (undefined :: (LTree N3 :. Pair) ()))
352341
353342-- main = go "foo" (size (undefined :: Pair ()))
354343
@@ -377,13 +366,13 @@ main = go "foo" (size (undefined :: RTree N1 ()))
377366
378367-- main = go "foo" (exp :: Double -> Double)
379368
380- #endif
369+ ---- End FFT
381370
382371-- main = go "map-not-v5" (fmap not :: Vec N5 Bool -> Vec N5 Bool)
383372
384373-- main = go "map-square-v5" (fmap square :: Vec N5 Int -> Vec N5 Int)
385374
386- -- main = go "map-t3 " (fmap not :: Unop (RTree N3 Bool))
375+ -- main = go "map-rt3 " (fmap not :: Unop (RTree N3 Bool))
387376
388377-- main = go "tdott-2" (dot''' :: Pair (RTree N2 Int) -> Int)
389378
@@ -439,10 +428,10 @@ main = go "foo" (size (undefined :: RTree N1 ()))
439428-- main = go "test" (dot :: RTree N4 (Int,Int) -> Int)
440429
441430-- -- Ranksep: rt1=0.5, rt2=1, rt3=2, rt4=4,rt5=8
442- -- main = goSep "transpose-pt4 " 4 (transpose :: Pair (RTree N4 Bool) -> RTree N4 (Pair Bool))
431+ -- main = goSep "transpose-prt4 " 4 (transpose :: Pair (RTree N4 Bool) -> RTree N4 (Pair Bool))
443432
444433-- -- Ranksep: rt1=0.5, rt2=1, rt3=2, rt4=4,rt5=8
445- -- main = goSep "transpose-t4p" 4 (transpose :: RTree N4 (Pair Bool) -> Pair (RTree N4 Bool))
434+ -- main = goSep "transpose-rt2p" 1 (transpose :: RTree N2 (Pair Bool) -> Pair (RTree N2 Bool))
446435
447436-- -- Ranksep: rt1=1, rt2=2, rt3=4, rt4=8, rt5=16
448437-- main = goSep "transpose-v3t5" 16 (transpose :: Vec N3 (RTree N5 Bool) -> RTree N5 (Vec N3 Bool))
0 commit comments