# NOT RUN {
parts(5)
diffparts(10)
matplot(t(diffparts(27)),type='l',lty=1)
restrictedparts(9,4)
restrictedparts(9,4,FALSE)
restrictedparts(9,4,decreasing=TRUE)
blockparts(1:4)
blockparts(1:4,3)
blockparts(1:4,3,include.fewer=TRUE)
blockparts(c(4,3,3,2),5) # Knuth's example, pre-fascicle 3a, p16
compositions(4) # not the same as parts(4)
compositions(4,4)
# With 10 blocks, enumerate all partitions with maxima of 1:5 and minima
# of c(0,1,1,2,1):
a <- c(0,1,1,2,1)
sweep(blockparts(1:5-a,10-sum(a)),1,a,"+")
#Knuth's example:
multiset(c(1,2,2,3))
multiset(rep(4+1:3,1:3),3)
# }
Run the code above in your browser using DataLab