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 "integer-partitions",
33 "rank-unrank",
34 ],
35 data_forms: &[
36 "bit-vector",
37 "subset",
38 "combination",
39 "permutation",
40 "partition",
41 ],
42 limits: "Counts are exact BigUint. Bitmask iterators cap cardinality at \
43 127; explosive enumerations require explicit bounds from the \
44 caller via take/limit.",
45 }];
46 CARDS
47}
48
49#[cfg(test)]
50mod tests {
51 use super::*;
52
53 #[test]
54 fn card_present() {
55 assert_eq!(combinatorics_cards()[0].key, "discrete/combinatorics");
56 }
57}