Browse files

Add a function data type. TODO: Adapted Chains for FFT recursion.

  • Loading branch information...
1 parent 2336de5 commit 784b69a1d3f3ca77dc849c8ea1726e0e777ad0b4 Grant Rotskoff committed Apr 30, 2012
Showing with 35 additions and 6 deletions.
  1. +14 −1 fft.hs
  2. +16 −2 partitions.hs
  3. +4 −2 sn.hs
  4. +1 −1 tableau.hs
View
15 fft.hs
@@ -9,6 +9,18 @@
-- Cooley-Tukey Fast Fourier Transform
module FFT where
+import Sn
+import Partitions
+import Tableau
+import Matrix
+import Functions
+
+
+
+
+{-
+Just some experiments with the C-T FFT...
+
data Complex = C {real :: Double, imaginary :: Double} deriving (Eq)
instance Show Complex where
show (C {real=a,imaginary=b}) = (show a) ++ " + " ++ (show b)++"i"
@@ -32,4 +44,5 @@ pad (P a)
factorContiguous :: [Int] -> [[Int]]
-factorContiguous a = [[i,i+1]| i <- a]
+factorContiguous a = [[i,i+1]| i <- a]
+-}
View
18 partitions.hs
@@ -5,17 +5,31 @@
module Partitions where
+import Data.List
+import qualified Data.Set as Set
+
newtype Partition = Part [Int] deriving (Show, Eq, Ord)
table (Part (x:[])) = show $ replicate x '*'
table (Part (x:xs)) = (show $ replicate x '*') ++ "\n" ++ (table (Part xs))
partitions :: Int -> [Partition]
partitions 0 = [Part []]
-partitions n = [ Part (i:xs) | i <- [1..n], (Part xs) <- partitions (n-i),
+partitions n = [Part (i:xs)| i <- [1..n], (Part xs) <- partitions (n-i),
null xs || i >= (head xs)]
--- For a list of ints in descending order
+-- Restriction of a representation to S_{n-1}
+res :: Partition -> [Partition]
+res (Part p) = map Part $ filter (not . null) $ map (\i -> listMod i p) [1..length(p)] where
+
+-- Just a helper function for restriction
+listMod :: Int -> [Int] -> [Int]
+listMod i p
+ | (reverse $ sort res) == res = filter (/=0) res
+ | otherwise = [] where
+ ls = splitAt i p
+ res = (init $ fst ls)++[(last $ fst ls)-1]++(snd ls)
+
hooks :: [Int] -> [Int]
hooks [] = []
View
6 sn.hs
@@ -19,7 +19,7 @@ import Group
-- A permutation is represented by a list of integers
newtype Permutation = Perm (Map.Map Int Int)
- deriving (Eq)
+ deriving (Eq,Ord)
instance Show Permutation where
show (Perm a) = "{ "++(spaces $ Map.toList a)++"}"
@@ -120,4 +120,6 @@ transToAdj [i,j] = undo ++ (reverse $ init undo) where
toAdjacent :: Permutation -> [[Int]]
toAdjacent = (concatMap transToAdj) . toTrans . toCycles
-
+
+adaptedChain :: Permutation -> [[Int]]
+adaptedChain a = undefined
View
2 tableau.hs
@@ -7,7 +7,7 @@
-- Displaying the standard tableau, various parts of the young diagram calculus
-module YoungCalculus where
+module Tableau where
import Partitions
import Sn

0 comments on commit 784b69a

Please sign in to comment.