module Math.Algebra.Jack.GPochhammer where import Math.Algebra.Jack (zonal) gpochhammer :: Fractional a => a -> [Int] -> a -> a gpochhammer :: a -> [Int] -> a -> a gpochhammer a a [Int] kappa a alpha = [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a product ([a] -> a) -> [a] -> a forall a b. (a -> b) -> a -> b $ (Int -> a) -> [Int] -> [a] forall a b. (a -> b) -> [a] -> [b] map (\Int i -> [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a product ([a] -> a) -> [a] -> a forall a b. (a -> b) -> a -> b $ (Int -> a) -> [Int] -> [a] forall a b. (a -> b) -> [a] -> [b] map (\Int j -> a a a -> a -> a forall a. Num a => a -> a -> a - (Int -> a forall a b. (Integral a, Num b) => a -> b fromIntegral Int i a -> a -> a forall a. Num a => a -> a -> a - a 1)a -> a -> a forall a. Fractional a => a -> a -> a /a alpha a -> a -> a forall a. Num a => a -> a -> a + Int -> a forall a b. (Integral a, Num b) => a -> b fromIntegral Int j a -> a -> a forall a. Num a => a -> a -> a -a 1) [Int 1 .. [Int] kappa [Int] -> Int -> Int forall a. [a] -> Int -> a !! (Int iInt -> Int -> Int forall a. Num a => a -> a -> a -Int 1)]) [Int 1 .. [Int] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [Int] kappa] hcoeff :: Fractional a => [a] -> [a] -> [Int] -> a -> a hcoeff :: [a] -> [a] -> [Int] -> a -> a hcoeff [a] a [a] b [Int] kappa a alpha = a numerator a -> a -> a forall a. Fractional a => a -> a -> a / a denominator a -> a -> a forall a. Fractional a => a -> a -> a / Int -> a forall a b. (Integral a, Num b) => a -> b fromIntegral (Int -> Int forall a. (Num a, Enum a) => a -> a factorial ([Int] -> Int forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a sum [Int] kappa)) where factorial :: a -> a factorial a n = [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a product [a 1 .. a n] numerator :: a numerator = [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a product ([a] -> a) -> [a] -> a forall a b. (a -> b) -> a -> b $ (a -> a) -> [a] -> [a] forall a b. (a -> b) -> [a] -> [b] map (\a x -> a -> [Int] -> a -> a forall a. Fractional a => a -> [Int] -> a -> a gpochhammer a x [Int] kappa a alpha) [a] a denominator :: a denominator = [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a product ([a] -> a) -> [a] -> a forall a b. (a -> b) -> a -> b $ (a -> a) -> [a] -> [a] forall a b. (a -> b) -> [a] -> [b] map (\a x -> a -> [Int] -> a -> a forall a. Fractional a => a -> [Int] -> a -> a gpochhammer a x [Int] kappa a alpha) [a] b testHypergeo :: Double testHypergeo :: Double testHypergeo = let a :: [Double] a = [Double 2,Double 3] in let b :: [Double] b = [Double 4] in let coeff :: [Int] -> Double coeff [Int] kappa = [Double] -> [Double] -> [Int] -> Double -> Double forall a. Fractional a => [a] -> [a] -> [Int] -> a -> a hcoeff [Double] a [Double] b [Int] kappa Double 2 in let kappas :: [[Int]] kappas = [[], [Int 1], [Int 1,Int 1], [Int 2]] in let x :: [Double] x = [Double 5,Double 6] in [Double] -> Double forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a sum ([Double] -> Double) -> [Double] -> Double forall a b. (a -> b) -> a -> b $ ([Int] -> Double) -> [[Int]] -> [Double] forall a b. (a -> b) -> [a] -> [b] map (\[Int] kappa -> [Int] -> Double coeff [Int] kappa Double -> Double -> Double forall a. Num a => a -> a -> a * [Double] -> [Int] -> Double forall a. (Fractional a, Ord a) => [a] -> [Int] -> a zonal [Double] x [Int] kappa) [[Int]] kappas _allPartitions :: Int -> [[Int]] _allPartitions :: Int -> [[Int]] _allPartitions Int m = [[[Int]]] -> [[Int]] forall a. [a] -> a last [[[Int]]] ps where ps :: [[[Int]]] ps = [] [[Int]] -> [[[Int]]] -> [[[Int]]] forall a. a -> [a] -> [a] : (Int -> [[Int]]) -> [Int] -> [[[Int]]] forall a b. (a -> b) -> [a] -> [b] map Int -> [[Int]] parts [Int 1..Int m] parts :: Int -> [[Int]] parts Int n = [Int n] [Int] -> [[Int]] -> [[Int]] forall a. a -> [a] -> [a] : [Int x Int -> [Int] -> [Int] forall a. a -> [a] -> [a] : [Int] p | Int x <- [Int 1..Int n], [Int] p <- [[[Int]]] ps [[[Int]]] -> Int -> [[Int]] forall a. [a] -> Int -> a !! (Int n Int -> Int -> Int forall a. Num a => a -> a -> a - Int x), Int x Int -> Int -> Bool forall a. Ord a => a -> a -> Bool <= [Int] -> Int forall a. [a] -> a head [Int] p] hypergeoPQ :: (Fractional a, Ord a) => Int -> [a] -> [a] -> [a] -> a hypergeoPQ :: Int -> [a] -> [a] -> [a] -> a hypergeoPQ Int m [a] a [a] b [a] x = [a] -> a forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a sum ([a] -> a) -> [a] -> a forall a b. (a -> b) -> a -> b $ ([Int] -> a) -> [[Int]] -> [a] forall a b. (a -> b) -> [a] -> [b] map (\[Int] kappa -> [Int] -> a coeff [Int] kappa a -> a -> a forall a. Num a => a -> a -> a * [a] -> [Int] -> a forall a. (Fractional a, Ord a) => [a] -> [Int] -> a zonal [a] x [Int] kappa) [[Int]] kappas where kappas :: [[Int]] kappas = ([Int] -> Bool) -> [[Int]] -> [[Int]] forall a. (a -> Bool) -> [a] -> [a] filter (\[Int] kap -> [Int] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [Int] kap Int -> Int -> Bool forall a. Ord a => a -> a -> Bool <= [a] -> Int forall (t :: * -> *) a. Foldable t => t a -> Int length [a] x) (Int -> [[Int]] _allPartitions Int m) coeff :: [Int] -> a coeff [Int] kappa = [a] -> [a] -> [Int] -> a -> a forall a. Fractional a => [a] -> [a] -> [Int] -> a -> a hcoeff [a] a [a] b [Int] kappa a 2