blob: 0e4e515ad08169cdf5e897b98191d62ea3144df6 (
plain) (
tree)
|
|
b0VIM 8.0 :BMY4%\ �
bacon office ~bacon/codes/AlgComb/Math/Combinatorics/YoungTableaux.hs utf-8
3210 #"! U tp _ ad � 9 _ � � � � � � T S ' � � � � � k ' & �
�
�
�
z
y
U
8
7
3
� � � U M L � � P 9 �
�
�
x
[
Z
8
*
� ^ � � � � o ] A � � � � � r , � � � � c b @ � q p E ( � � � � � k I / � � W 9 reduceWord'' xs ys = xs ++ ys else reduceWord'' (init xs) (last xs:u:v:w:ys) else reduceWord'' (init xs) (last xs:v:u:w:ys) then if u > w then reduceWord'' (init xs) (last xs:u:w:v:ys) else if w < v && u <= v then xs ++ (u:v:w:ys) if isRowWord $ xs ++ (u:v:w:ys) reduceWord'' xs (u:v:w:ys) = else u:v:w:ys else v:u:w:ys then if u > w then u:w:v:ys else if w < v && u <= v then u:v:w:ys if isRowWord (u:v:w:ys) reduceWord'' [] (u:v:w:ys) = reduceWord'' :: Ord a => [a] -> [a] -> [a] prop_ReduceWord_RobinsonSchensted xs = (toRowWord $ robinsonSchensted xs) == (reduceWord xs) prop_ReduceWord_RobinsonSchensted :: [Int] -> Bool prop_ReduceWord' xs = (length xs) == (length $ reduceWord xs) prop_ReduceWord' :: [Int] -> Bool prop_ReduceWord = isRowWord . reduceWord prop_ReduceWord :: [Int] -> Bool else reduceWord' (init xs) (last xs, u, v) (w:ys) else reduceWord' (init xs) (last xs, v, u) (w:ys) then if u > w then reduceWord' (init xs) (last xs, u, w) (v:ys) else if w < v && u <= v then xs ++ (u:v:w:ys) if isRowWord $ xs ++ (u:v:w:ys) reduceWord' xs (u, v, w) ys = else u:v:w:ys else v:u:w:ys then if u > w then u:w:v:ys else if w < v && u <= v then u:v:w:ys if isRowWord (u:v:w:ys) reduceWord' [] (u, v, w) ys = reduceWord' :: Ord a => [a] -> (a, a, a) -> [a] -> [a] reduceWord'' zs (ws ++ [last xs]) --} let (zs, ws) = splitAt (length ys - 2) ys in {-- | otherwise = let ys = reduceWord $ init xs in | otherwise = let ys = reduceWord $ init xs in reduceWord' (init $ init ys) (last $ init ys, last ys, last xs) [] | length xs <= 2 = xs reduceWord xs reduceWord :: Ord a => [a] -> [a] isRowWord = isRowWord' [] [] isRowWord :: Ord a => [a] -> Bool else ys == [] && isRowWord' [] xs zs then head ys > head zs && (isRowWord' (xs ++ [head zs]) (tail ys) (tail zs)) if xs == [] || last xs <= head zs isRowWord' xs ys zs = isRowWord' xs [] zs = if last xs <= head zs then isRowWord' (xs ++ [head zs]) [] (tail zs) else isRowWord' [] xs zs isRowWord' [] [] zs = isRowWord' [head zs] [] (tail zs) isRowWord' _ ys [] = ys == [] isRowWord' :: Ord a => [a] -> [a] -> [a] -> Bool --} (r1, r2) -> let S s = rowInsert (S (tail t)) (head r2) in S $ (r1 ++ x:(tail r2)):s (r, []) -> S $ (r ++ [x]):(tail t) case break (>x) (head t) of rowInsert (S t) x = rowInsert :: Ord a => SSYT a -> a -> SSYT a {-- toRowWord = concat . reverse toRowWord :: Ord a => SSYT a -> [a] truncInfList = fst . break null truncInfList :: [[a]] -> [[a]] robinsonSchensted = truncInfList . foldl rowInsert' (repeat []) robinsonSchensted :: Ord a => [a] -> SSYT a (r1, r2) -> (r1 ++ x:(tail r2)):(rowInsert' (tail t) (head r2)) (r, []) -> (r ++ [x]):(tail t) case break (>x) (head t) of rowInsert' t x = rowInsert' :: Ord a => SSYT a -> a -> SSYT a rowInsert t = truncInfList . rowInsert' (t ++ (repeat [])) rowInsert :: Ord a => SSYT a -> a -> SSYT a --where show (S xs) = show $ fst $ break null xs --instance Show a => Show (SSYT a) type GT a = [[a]] type SSYT a = [[a]] --data SSYT a = S [[a]] type Tableau a = [[a]]
|