combinat-0.2.1: Generation of various combinatorial objects.

Math.Combinat.Partitions

Contents

Description

Partitions. Partitions are nonincreasing sequences of positive integers.

Synopsis

Type and basic stuff

data Partition Source

The additional invariant enforced here is that partitions are monotone decreasing sequences of positive integers.

toPartition :: [Int] -> PartitionSource

Checks whether the input is a partition.

toPartitionUnsafe :: [Int] -> PartitionSource

Assumes that the input is decreasing.

mkPartition :: [Int] -> PartitionSource

Sorts the input.

height :: Partition -> IntSource

The first element of the sequence.

width :: Partition -> IntSource

The length of the sequence.

weight :: Partition -> IntSource

The weight of the partition (that is, the sum of the corresponding sequence).

dualPartition :: Partition -> PartitionSource

The dual (or conjugate) partition.

Generation

_partitions'Source

Arguments

:: (Int, Int)

(height,width)

-> Int

d

-> [[Int]] 

Partitions of d, fitting into a given rectangle, as lists.

partitions'Source

Arguments

:: (Int, Int)

(height,width)

-> Int

d

-> [Partition] 

Partitions of d, fitting into a given rectangle. The order is again lexicographic.

_partitions :: Int -> [[Int]]Source

Partitions of d, as lists

partitions :: Int -> [Partition]Source

Partitions of d.

allPartitions'Source

Arguments

:: (Int, Int)

(height,width)

-> [[Partition]] 

All partitions fitting into a given rectangle.

allPartitions :: Int -> [[Partition]]Source

All partitions up to a given degree.

countAllPartitions' :: (Int, Int) -> IntegerSource

# = \binom { h+w } { h }