combinat-0.2.4.1: Generation of various combinatorial objects.Source codeContentsIndex
Math.Combinat.Tuples
Description
Tuples.
Synopsis
tuples' :: [Int] -> [[Int]]
tuples1' :: [Int] -> [[Int]]
countTuples' :: [Int] -> Integer
countTuples1' :: [Int] -> Integer
tuples :: Int -> Int -> [[Int]]
tuples1 :: Int -> Int -> [[Int]]
countTuples :: Int -> Int -> Integer
countTuples1 :: Int -> Int -> Integer
binaryTuples :: Int -> [[Bool]]
Documentation
tuples' :: [Int] -> [[Int]]Source

"Tuples" fitting into a give shape. The order is lexicographic, that is,

 sort ts == ts where ts = tuples' shape

Example:

 tuples' [2,3] = 
   [[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3],[2,0],[2,1],[2,2],[2,3]]
tuples1' :: [Int] -> [[Int]]Source
positive "tuples" fitting into a give shape.
countTuples' :: [Int] -> IntegerSource
# = \prod_i (m_i + 1)
countTuples1' :: [Int] -> IntegerSource
# = \prod_i m_i
tuplesSource
:: Intlength (width)
-> Intmaximum (height)
-> [[Int]]
tuples1Source
:: Intlength (width)
-> Intmaximum (height)
-> [[Int]]
countTuples :: Int -> Int -> IntegerSource
# = (m+1) ^ len
countTuples1 :: Int -> Int -> IntegerSource
# = m ^ len
binaryTuples :: Int -> [[Bool]]Source
Produced by Haddock version 2.6.1