File tree Expand file tree Collapse file tree 1 file changed +25
-18
lines changed
Expand file tree Collapse file tree 1 file changed +25
-18
lines changed Original file line number Diff line number Diff line change 3535 @test prevprod ([2 , 3 , 5 ], 30 ) == 30
3636 @test prevprod ([2 , 3 , 5 ], 33 ) == 32
3737
38- # noncrossing partitions
39- let nc4 = ncpartitions (4 )
40- @test nc4 == Any[
41- Any[[1 ], [2 ], [3 ], [4 ]],
42- Any[[1 ], [2 ], [3 , 4 ]],
43- Any[[1 ], [2 , 3 ], [4 ]],
44- Any[[1 ], [2 , 4 ], [3 ]],
45- Any[[1 ], [2 , 3 , 4 ]],
46- Any[[1 , 2 ], [3 ], [4 ]],
47- Any[[1 , 2 ], [3 , 4 ]],
48- Any[[1 , 3 ], [2 ], [4 ]],
49- Any[[1 , 4 ], [2 ], [3 ]],
50- Any[[1 , 4 ], [2 , 3 ]],
51- Any[[1 , 2 , 3 ], [4 ]],
52- Any[[1 , 3 , 4 ], [2 ]],
53- Any[[1 , 2 , 4 ], [3 ]],
54- Any[[1 , 2 , 3 , 4 ]],
38+ @testset " noncrossing partitions" begin
39+ @test ncpartitions (0 ) == []
40+ @test ncpartitions (1 ) == [[[1 ]]]
41+ @test ncpartitions (2 ) == [[[1 ], [2 ]], [[1 , 2 ]]]
42+ # The 14 noncrossing partitions of a 4-element set ordered in a Hasse diagram
43+ # https://commons.wikimedia.org/wiki/File:Noncrossing_partitions_4;_Hasse.svg
44+ @test ncpartitions (4 ) == [
45+ [[1 ], [2 ], [3 ], [4 ]],
46+ [[1 ], [2 ], [3 , 4 ]],
47+ [[1 ], [2 , 3 ], [4 ]],
48+ [[1 ], [2 , 4 ], [3 ]],
49+ [[1 ], [2 , 3 , 4 ]],
50+ [[1 , 2 ], [3 ], [4 ]],
51+ [[1 , 2 ], [3 , 4 ]],
52+ [[1 , 3 ], [2 ], [4 ]],
53+ [[1 , 4 ], [2 ], [3 ]],
54+ [[1 , 4 ], [2 , 3 ]],
55+ [[1 , 2 , 3 ], [4 ]],
56+ [[1 , 3 , 4 ], [2 ]],
57+ [[1 , 2 , 4 ], [3 ]],
58+ [[1 , 2 , 3 , 4 ]],
5559 ]
56- @test length (nc4) == catalannum (4 )
60+
61+ for n in 1 : 8
62+ @test length (ncpartitions (n)) == catalannum (n)
63+ end
5764 end
5865
5966end
You can’t perform that action at this time.
0 commit comments