|
2 | 2 | # Copyright Peter Luschny. License is MIT. |
3 | 3 | # This file includes parts from Combinatorics.jl in modified form. |
4 | 4 |
|
5 | | -# Version of: UTC 2019-10-26 10:41:45 |
6 | | -# 71458000-f7cc-11e9-0078-e76d536f0017 |
| 5 | +# Version of: UTC 2019-10-26 11:05:54 |
| 6 | +# d0bdc762-f7cf-11e9-039b-3d57130533ac |
7 | 7 |
|
8 | 8 | # Do not edit this file, it is generated from the modules and will be overwritten! |
9 | 9 | # Edit the modules in the src directory and build this file with BuildSequences.jl! |
@@ -123,7 +123,6 @@ ModuleSeqUtils, |
123 | 123 | ModuleSeriesExpansion, |
124 | 124 | ModuleSetPartitions, |
125 | 125 | ModuleSetPartitionsMType, |
126 | | -ModuleSetPartitionsMType, |
127 | 126 | ModuleStirlingNumbers, |
128 | 127 | ModuleSwingFactorial, |
129 | 128 | ModuleTriangles, |
@@ -7882,45 +7881,6 @@ Return the numbers of partitions of an ``n``-set into nonempty subsets. |
7882 | 7881 | $(SIGNATURES) |
7883 | 7882 | """ |
7884 | 7883 | SetNumber(n::Int) = Int(Nemo.bell(n)) |
7885 | | -# *** SetPartitionsByShape.jl **************** |
7886 | | -""" |
7887 | | -
|
7888 | | -general Definition |
7889 | | -
|
7890 | | -* exported functions |
7891 | | -""" |
7892 | | -const ModuleSetPartitionsMType = "" |
7893 | | -function P(m, n) |
7894 | | -R, x = PolynomialRing(ZZ, "x") |
7895 | | -function recP(m, n, x) |
7896 | | -n == 0 && return R(1) |
7897 | | -sum(binomial(m*n, m*k)*recP(m, n-k, x)*x for k in 1:n) |
7898 | | -end |
7899 | | -n == 0 && return [ZZ(1)] |
7900 | | -p = recP(m, n, x) |
7901 | | -[coeff(p, k) for k in 0:n] |
7902 | | -end |
7903 | | -function xmSetPartitions(m, n, k) |
7904 | | -shapes = (map(x -> x*m, p) for p in IntegerPartitions(n, k)) |
7905 | | -p = [] |
7906 | | -if shapes != Nothing |
7907 | | -for s in shapes |
7908 | | -if s != Nothing |
7909 | | -vcat(p, [p for p in SetPartitions(s)]) |>println |
7910 | | -end end |
7911 | | -end |
7912 | | -end |
7913 | | -function SP_byLength(m, n) |
7914 | | -n == 0 && return [n] |
7915 | | -[sum(mSetPartitions(m, n, k)) for k in 1:n] |
7916 | | -end |
7917 | | -function SP_byShape(m, n) |
7918 | | -[p for k in 1:n for p in mSetPartitions(m, n, k)] |
7919 | | -end |
7920 | | -RowSum(m, n) = sum(SP_byLength(m, n)) |
7921 | | -ARowSum(m, n) = sum((-1)^k*sum(mSetPartitions(m, n, k)) for k in 0:n) |
7922 | | -Diagonal(m,n) = mSetPartitions(m, n, n)[0] |
7923 | | -Central(m, n) = SP_byLength(m, 2n)[n] |
7924 | 7884 | # *** SetPartitionsMType.jl **************** |
7925 | 7885 | """ |
7926 | 7886 |
|
|
0 commit comments