pub trait AbelianGroup: 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 is_zero(&self, elem: &Self::Elem) -> bool { ... }
    fn neg_assign(&self, elem: &mut Self::Elem) { ... }
    fn add_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem) { ... }
    fn double(&self, elem: &mut Self::Elem) { ... }
    fn sub(&self, elem1: &Self::Elem, elem2: &Self::Elem) -> Self::Elem { ... }
    fn sub_assign(&self, elem1: &mut Self::Elem, elem2: &Self::Elem) { ... }
    fn times(&self, num: isize, elem: &Self::Elem) -> Self::Elem { ... }
}
Expand description

A commutative group written in additive notation. Typical examples are the additive structures of rings, fields and vector spaces.

Required Methods

The additive identity element of the ring.

The additive inverse of the given element.

The additive sum of the given elements

Provided Methods

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

The element is changed to its additive inverse.

The second element is added to the first one.

Doubles the given element in place.

The difference of the given elements.

The second element is subtracted from the first one.

Returns an integer multiple of the given element.

Implementors