Struct MultiplicativeGroup

Source
pub struct MultiplicativeGroup<A>
where A: Monoid,
{ /* private fields */ }
Expand description

The multiplicative group of a unitary ring or field, or more generally the group of invertible elements of any monoid.

Implementations§

Source§

impl<A> MultiplicativeGroup<A>
where A: Monoid,

Source

pub fn new(base: A) -> Self

Creates a new multiplicative group from the given base.

Source

pub fn base(&self) -> &A

Returns the base monoid from which this group was created.

Trait Implementations§

Source§

impl<A> Clone for MultiplicativeGroup<A>
where A: Monoid + Clone,

Source§

fn clone(&self) -> MultiplicativeGroup<A>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A> Debug for MultiplicativeGroup<A>
where A: Monoid + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A> Domain for MultiplicativeGroup<A>
where A: Monoid,

Source§

type Elem = <A as Domain>::Elem

The type of the elements of this domain.
Source§

fn contains(&self, elem: &Self::Elem) -> bool

Checks if the given object is a member of the domain.
Source§

fn equals(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> bool

Checks if the given objects represent the same element of the set.
Source§

impl<A> Group for MultiplicativeGroup<A>
where A: Monoid,

Source§

fn inv(&self, elem: &Self::Elem) -> Self::Elem

Returns the inverse of the given element element.
Source§

fn power(&self, num: isize, elem: &Self::Elem) -> Self::Elem

Returns the power of the given element using the square and multiply method.
Source§

impl<A> Monoid for MultiplicativeGroup<A>
where A: Monoid,

Source§

fn one(&self) -> Self::Elem

The multiplicative identity element of the ring.
Source§

fn is_one(&self, elem: &Self::Elem) -> bool

Checks if the given element is the multiplicative identity.
Source§

fn try_inv(&self, elem: &Self::Elem) -> Option<Self::Elem>

Calculates the multiplicative inverse of the given element if it exists.
Source§

fn invertible(&self, _elem: &Self::Elem) -> bool

Returns true if the given element has a multiplicative inverse.
Source§

impl<A> Semigroup for MultiplicativeGroup<A>
where A: Monoid,

Source§

fn mul(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem

The multiplicative product of the given elements.
Source§

fn mul_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem)

The first element is multiplied with the second one in place.
Source§

fn square(&self, elem: &mut Self::Elem)

Squares the given element in place.

Auto Trait Implementations§

§

impl<A> Freeze for MultiplicativeGroup<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for MultiplicativeGroup<A>
where A: RefUnwindSafe,

§

impl<A> Send for MultiplicativeGroup<A>
where A: Send,

§

impl<A> Sync for MultiplicativeGroup<A>
where A: Sync,

§

impl<A> Unpin for MultiplicativeGroup<A>
where A: Unpin,

§

impl<A> UnwindSafe for MultiplicativeGroup<A>
where A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.