pub struct FreeGroupElement {
pub letters: Vec<(char, bool)>,
}Expand description
An element of the free group over an alphabet char, represented as a
reduced word (alternating generators and their inverses).
Fields§
§letters: Vec<(char, bool)>Letters: positive = generator, negative = inverse.
E.g., [(b'a', true), (b'b', false)] means a * b⁻¹.
Implementations§
Source§impl FreeGroupElement
impl FreeGroupElement
Sourcepub fn generator_inv(c: char) -> Self
pub fn generator_inv(c: char) -> Self
The inverse of a single generator.
Sourcepub fn mul(&self, other: &Self) -> Self
pub fn mul(&self, other: &Self) -> Self
Concatenate and reduce (cancel adjacent inverse pairs).
Sourcepub fn is_identity(&self) -> bool
pub fn is_identity(&self) -> bool
Check if this is the identity.
Trait Implementations§
Source§impl Clone for FreeGroupElement
impl Clone for FreeGroupElement
Source§fn clone(&self) -> FreeGroupElement
fn clone(&self) -> FreeGroupElement
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 moreSource§impl Debug for FreeGroupElement
impl Debug for FreeGroupElement
Source§impl PartialEq for FreeGroupElement
impl PartialEq for FreeGroupElement
impl Eq for FreeGroupElement
impl StructuralPartialEq for FreeGroupElement
Auto Trait Implementations§
impl Freeze for FreeGroupElement
impl RefUnwindSafe for FreeGroupElement
impl Send for FreeGroupElement
impl Sync for FreeGroupElement
impl Unpin for FreeGroupElement
impl UnsafeUnpin for FreeGroupElement
impl UnwindSafe for FreeGroupElement
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