|
|
|
|
|
| Description |
Partitions. Partitions are nonincreasing sequences of positive integers.
See also
Donald E. Knuth: The Art of Computer Programming, vol 4, pre-fascicle 3B.
|
|
| Synopsis |
|
|
|
|
| Type and basic stuff
|
|
|
| The additional invariant enforced here is that partitions
are monotone decreasing sequences of positive integers.
| Instances | |
|
|
|
| Checks whether the input is a partition. See the note at isPartition!
|
|
|
| Assumes that the input is decreasing.
|
|
|
| Sorts the input, and cuts the nonpositive elements.
|
|
|
| Note: we only check that the sequence is ordered, but we do not check for
negative elements. This can be useful when working with symmetric functions.
It may also change in the future...
|
|
|
|
|
| The first element of the sequence.
|
|
|
| The length of the sequence.
|
|
|
|
|
| The weight of the partition
(that is, the sum of the corresponding sequence).
|
|
|
| The dual (or conjugate) partition.
|
|
|
|
|
Example:
elements (toPartition [5,2,1]) ==
[ (1,1), (1,2), (1,3), (1,4), (1,5)
, (2,1), (2,2), (2,3), (2,4)
, (3,1)
]
|
|
|
|
|
| Computes the number of "automorphisms" of a given partition.
|
|
|
|
| Generation
|
|
|
| :: (Int, Int) | (height,width)
| | -> Int | d
| | -> [Partition] | | | Partitions of d, fitting into a given rectangle. The order is again lexicographic.
|
|
|
|
| :: (Int, Int) | (height,width)
| | -> Int | d
| | -> [[Int]] | | | Partitions of d, fitting into a given rectangle, as lists.
|
|
|
|
|
|
| Partitions of d.
|
|
|
| Partitions of d, as lists
|
|
|
|
|
| :: (Int, Int) | (height,width)
| | -> [[Partition]] | | | All partitions fitting into a given rectangle.
|
|
|
|
| All partitions up to a given degree.
|
|
|
| # = \binom { h+w } { h }
|
|
|
|
| Paritions of multisets, vector partitions
|
|
| partitionMultiset :: (Eq a, Ord a) => [a] -> [[[a]]] | Source |
|
| Partitions of a multiset.
|
|
|
| Integer vectors. The indexing starts from 1.
|
|
|
| Vector partitions. Basically a synonym for fasc3B_algorithm_M.
|
|
|
|
|
| Generates all vector partitions
("algorithm M" in Knuth).
The order is decreasing lexicographic.
|
|
| Produced by Haddock version 2.6.1 |