sim_lib_discrete_comb/
cards.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub struct CardSpec {
6 pub key: &'static str,
8 pub summary: &'static str,
10 pub operations: &'static [&'static str],
12 pub data_forms: &'static [&'static str],
14 pub limits: &'static str,
16}
17
18pub fn combinatorics_cards() -> &'static [CardSpec] {
20 const CARDS: &[CardSpec] = &[CardSpec {
21 key: "discrete/combinatorics",
22 summary: "Exact counts, lazy enumerators, and canonical ordinals.",
23 operations: &[
24 "factorial",
25 "binomial",
26 "stirling2",
27 "bell-number",
28 "integer-partition-count",
29 "subsets",
30 "combinations",
31 "permutations",
32 "words",
33 "integer-partitions",
34 "canonical-cycles",
35 "longest-only",
36 "rank-unrank",
37 ],
38 data_forms: &[
39 "word",
40 "bit-vector",
41 "subset",
42 "combination",
43 "permutation",
44 "cycle",
45 "partition",
46 ],
47 limits: "Counts are exact BigUint. Bitmask iterators cap cardinality at \
48 127; explosive enumerations require explicit bounds from the \
49 caller via take/limit.",
50 }];
51 CARDS
52}
53
54#[cfg(test)]
55mod tests {
56 use super::*;
57
58 #[test]
59 fn card_present() {
60 assert_eq!(combinatorics_cards()[0].key, "discrete/combinatorics");
61 }
62}