PartitionsAndPermutations¶
partperm.spad line 1 [edit on github]
PartitionsAndPermutations contains functions for generating streams of integer partitions, and streams of sequences of integers composed from a multi-set.
- conjugates: Stream List Integer -> Stream List Integer
conjugates(lp)is the stream of conjugates of a stream of partitionslp.
- distinct_partitions: (Integer, Integer, Integer) -> Stream List Integer
distinct_partitions(p, l, n)is the stream of partitions ofninto distinct numbers whose number of parts is no greater thanpand whose largest part is no greater thanl.
- distinct_partitions: Integer -> Stream List Integer
distinct_partitions(n)is the stream of all partitions ofninto distinct numbers.
- odd_partitions: (Integer, Integer, Integer) -> Stream List Integer
odd_partitions(p, l, n)is the stream of partitions ofninto odd numbers whose number of parts is no greater thanpand whose largest part is no greater thanl.
- odd_partitions: Integer -> Stream List Integer
odd_partitions(n)is the stream of all partitions ofninto odd numbers.
- partitions: (Integer, Integer) -> Stream List Integer
partitions(p, l)is the stream of all partitions whose number of parts and largest part are no greater thanpandl.
- partitions: (Integer, Integer, Integer) -> Stream List Integer
partitions(p, l, n)is the stream of partitions ofnwhose number of parts is no greater thanpand whose largest part is no greater thanl.
- permutations: Integer -> Stream List Integer
permutations(n)is the stream of permutations formed from1, 2, 3, ..., n.
- sequences: (List Integer, List Integer) -> Stream List Integer
sequences(l1, l2)is the stream of all sequences that can be composed from the multiset defined from two lists of integersl1andl2. For example, the pair([1, 2, 4], [2, 3, 5])represents multi-set with 12, 23's, and 45's.
- sequences: List Integer -> Stream List Integer
sequences([l0, l1, l2, .., ln])is the set of all sequences formed froml00's,l11's,l22's, …,lnn's.