pub struct CycleIndexPolynomial {
pub group_name: String,
pub terms: Vec<(u64, Vec<u32>)>,
pub group_order: u64,
}Expand description
Represents the cycle index polynomial Z(G; x₁, …, xₙ) of a permutation group.
The cycle index is stored as a list of monomials, where each monomial is represented as a vector of exponents (e[i] = exponent of x_{i+1}).
Fields§
§group_name: StringGroup name (for display).
terms: Vec<(u64, Vec<u32>)>Each term: (coefficient, exponent_vector). The polynomial is (1/|G|) * ∑ coeff * ∏ x_i^{e_i}.
group_order: u64Order of the group |G|.
Implementations§
Source§impl CycleIndexPolynomial
impl CycleIndexPolynomial
Sourcepub fn new(group_name: impl Into<String>, group_order: u64) -> Self
pub fn new(group_name: impl Into<String>, group_order: u64) -> Self
Create a new cycle index for a named group.
Sourcepub fn eval_all_ones(&self) -> u64
pub fn eval_all_ones(&self) -> u64
Evaluate Z(G; 1, 1, …, 1) = |G| / |G| = 1 (should return 1).
Sourcepub fn burnside_count(&self, k: u64) -> u64
pub fn burnside_count(&self, k: u64) -> u64
Apply Burnside’s lemma: the number of distinct colorings with k colors is Z(G; k, k, …, k).
Each term (coeff, exps) contributes coeff * ∏_i k^{exps[i]} = coeff * k^{∑ exps[i]}.
Trait Implementations§
Source§impl Clone for CycleIndexPolynomial
impl Clone for CycleIndexPolynomial
Source§fn clone(&self) -> CycleIndexPolynomial
fn clone(&self) -> CycleIndexPolynomial
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CycleIndexPolynomial
impl RefUnwindSafe for CycleIndexPolynomial
impl Send for CycleIndexPolynomial
impl Sync for CycleIndexPolynomial
impl Unpin for CycleIndexPolynomial
impl UnsafeUnpin for CycleIndexPolynomial
impl UnwindSafe for CycleIndexPolynomial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more