Trait qsym2::chartab::chartab_symbols::CollectionSymbol

source ·
pub trait CollectionSymbol: MathematicalSymbol {
    type CollectionElement;

    // Required methods
    fn from_reps(
        symstr: &str,
        reps: Option<Vec<Self::CollectionElement>>,
    ) -> Result<Self, GenericSymbolParsingError>;
    fn representative(&self) -> Option<&Self::CollectionElement>;
    fn representatives(&self) -> Option<&Vec<Self::CollectionElement>>;

    // Provided method
    fn size(&self) -> usize { ... }
}
Expand description

Trait for symbols describing collections of objects such as conjugacy classes.

Required Associated Types§

source

type CollectionElement

The type of the elements in the collection.

Required Methods§

source

fn from_reps( symstr: &str, reps: Option<Vec<Self::CollectionElement>>, ) -> Result<Self, GenericSymbolParsingError>

Constructs a collection symbol from a string and one or more representative collection elements.

§Arguments
  • symstr - A string to be parsed. See GenericSymbol::from_str for more information.
  • reps - An optional vector of one or more representative collection elements.
§Errors

Returns an error if symstr cannot be parsed.

source

fn representative(&self) -> Option<&Self::CollectionElement>

The first representative element of the collection.

source

fn representatives(&self) -> Option<&Vec<Self::CollectionElement>>

All representative elements of the collection.

Provided Methods§

source

fn size(&self) -> usize

The size of the collection which is given by the number of representative elements multiplied by the multiplicity of the symbol. If no representative elements exist, then the size is taken to be the multiplicity of the symbol itself.

Object Safety§

This trait is not object safe.

Implementors§