[][src]Trait abstalg::UnitaryRing

pub trait UnitaryRing: Domain {
    fn zero(&self) -> Self::Elem;
fn neg(&self, elem: &Self::Elem) -> Self::Elem;
fn add(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem;
fn one(&self) -> Self::Elem;
fn mul(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem; fn is_zero(&self, elem: &Self::Elem) -> bool { ... }
fn sub(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem { ... }
fn is_one(&self, elem: &Self::Elem) -> bool { ... } }

A ring with an identity element (not necessarily commutative). Typical examples are the rings of rectangular matrices, integers and polynomials. Some operations may panic (for example, the underlying type cannot represent the real result).

Required methods

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

The additive identity element of the ring.

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

The additive inverse of the given element.

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

The additive sum of the given elements

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

The multiplicative identity element of the ring.

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

The multiplicative product of the given elements.

Loading content...

Provided methods

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

Checks if the given element is the additive identity of the ring.

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

The difference of the given elements.

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

Checks if the given element is the multiplicative identity of the ring.

Loading content...

Implementors

impl UnitaryRing for Integers[src]

impl<E> UnitaryRing for ApproxFloats<E> where
    E: Float + Debug + Zero + One
[src]

impl<E> UnitaryRing for CheckedInts<E> where
    E: PrimInt + Signed + Debug + From<i8>, 
[src]

impl<E> UnitaryRing for ModularInts<E> where
    E: PrimInt + Signed + WrappingAdd + WrappingMul + WrappingSub + Debug + From<i8>, 
[src]

impl<R> UnitaryRing for Polynomials<R> where
    R: UnitaryRing
[src]

impl<R: EuclideanDomain> UnitaryRing for QuotientField<R>[src]

impl<R: EuclideanDomain> UnitaryRing for QuotientRing<R>[src]

Loading content...