combinat-0.2.5.0: Generation of various combinatorial objects.

Safe HaskellNone

Math.Combinat.Compositions

Description

Synopsis

Documentation

compositions'Source

Arguments

:: [Int]

shape

-> Int

sum

-> [[Int]] 

Compositions fitting into a given shape and having a given degree. The order is lexicographic, that is,

 sort cs == cs where cs = compositions' shape k

allCompositions1 :: Int -> [[Composition]]Source

All positive compositions of a given number (filtrated by the length). Total number of these is 2^(n-1)

allCompositions' :: [Int] -> [[Composition]]Source

All compositions fitting into a given shape.

compositionsSource

Arguments

:: Integral a 
=> a

length

-> a

sum

-> [[Int]] 

Compositions of a given length.

countCompositions :: Integral a => a -> a -> IntegerSource

# = \binom { len+d-1 } { len-1 }

compositions1Source

Arguments

:: Integral a 
=> a

length

-> a

sum

-> [[Int]] 

Positive compositions of a given length.