# HG changeset patch
# User Mike Hansen <mhansen@gmail.com>
# Date 1232765718 28800
# Node ID 8c9eff3598f287e61202bd5e6de3ec82cd948120
# Parent 543befb306ba3728990e9104ad79a13b3402aa4e
Fixed minor formatting issues in #4813.
diff -r 543befb306ba -r 8c9eff3598f2 sage/tests/arxiv_0812_2725.py
|
a
|
b
|
|
| 40 | 40 | from sage.combinat.set_partition import SetPartitions as SetPartitions |
| 41 | 41 | |
| 42 | 42 | def CompleteMatchings(n): |
| 43 | | """Return a generator for the complete matchings of the set [1..n]. |
| | 43 | """ |
| | 44 | Return a generator for the complete matchings of the set [1..n]. |
| 44 | 45 | |
| 45 | 46 | INPUT: |
| 46 | 47 | n -- nonnegative integer |
| … |
… |
|
| 72 | 73 | for m in matchingsset(range(1, n+1)): yield m |
| 73 | 74 | |
| 74 | 75 | def matchingsset(L): |
| 75 | | """Return a generator for complete matchings of the sequence L. |
| | 76 | """ |
| | 77 | Return a generator for complete matchings of the sequence L. |
| 76 | 78 | |
| 77 | 79 | This is not really meant to be called directly, but rather by |
| 78 | 80 | CompleteMatchings(). |
| … |
… |
|
| 163 | 165 | return d |
| 164 | 166 | |
| 165 | 167 | def setp_to_edges(p): |
| 166 | | """Transform a set partition into a list of edges. |
| | 168 | """ |
| | 169 | Transform a set partition into a list of edges. |
| 167 | 170 | |
| 168 | 171 | INPUT: |
| 169 | 172 | p -- a Sage set partition. |
| … |
… |
|
| 186 | 189 | return ans |
| 187 | 190 | |
| 188 | 191 | def dcrossvec_setp(n): |
| 189 | | """Return a list with the distribution of k-dcrossings on set partitions of [1..n]. |
| | 192 | """ |
| | 193 | Return a list with the distribution of k-dcrossings on set partitions of [1..n]. |
| 190 | 194 | |
| 191 | 195 | INPUT: |
| 192 | 196 | n -- a nonnegative integer. |
| … |
… |
|
| 222 | 226 | return vec |
| 223 | 227 | |
| 224 | 228 | def dcrossvec_cm(n): |
| 225 | | """Return a list with the distribution of k-dcrossings on complete matchings on n vertices. |
| | 229 | """ |
| | 230 | Return a list with the distribution of k-dcrossings on complete matchings on n vertices. |
| 226 | 231 | |
| 227 | 232 | INPUT: |
| 228 | 233 | n -- a nonnegative integer. |
| … |
… |
|
| 269 | 274 | return vec |
| 270 | 275 | |
| 271 | 276 | def tablecolumn(n, k): |
| 272 | | """Return column n of Table 1 or 2 from the paper arxiv:0812.2725. |
| | 277 | """ |
| | 278 | Return column n of Table 1 or 2 from the paper arxiv:0812.2725. |
| 273 | 279 | |
| 274 | 280 | INPUT: |
| 275 | 281 | n -- positive integer. |