alga::general

Trait AbstractRing

Source
pub trait AbstractRing<A: Operator = Additive, M: Operator = Multiplicative>: AbstractGroupAbelian<A> + AbstractMonoid<M> {
    // Provided methods
    fn prop_mul_and_add_are_distributive_approx(
        args: (Self, Self, Self),
    ) -> bool
       where Self: RelativeEq { ... }
    fn prop_mul_and_add_are_distributive(args: (Self, Self, Self)) -> bool
       where Self: Eq { ... }
}
Expand description

A ring is the combination of an Abelian group and a multiplicative monoid structure.

A ring is equipped with:

  • An abstract operator (usually the addition, “+”) that fulfills the constraints of an Abelian group.

    An Abelian group is a set with a closed commutative and associative addition with the divisibility property and an identity element.

  • A second abstract operator (usually the multiplication, “×”) that fulfills the constraints of a monoid.

    A set equipped with a closed associative multiplication with the divisibility property and an identity element.

The multiplication is distributive over the addition:

§Distributivity

a, b, c ∈ Self, a × (b + c) = a × b + a × c.

Provided Methods§

Source

fn prop_mul_and_add_are_distributive_approx(args: (Self, Self, Self)) -> bool
where Self: RelativeEq,

Returns true if the multiplication and addition operators are distributive for the given argument tuple. Approximate equality is used for verifications.

Source

fn prop_mul_and_add_are_distributive(args: (Self, Self, Self)) -> bool
where Self: Eq,

Returns true if the multiplication and addition operators are distributive for the given argument tuple.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl AbstractRing for f32

Source§

impl AbstractRing for f64

Source§

impl AbstractRing for i8

Source§

impl AbstractRing for i16

Source§

impl AbstractRing for i32

Source§

impl AbstractRing for i64

Source§

impl AbstractRing for i128

Source§

impl AbstractRing for isize

Source§

impl<N: Num + Clone + ClosedNeg + AbstractRing> AbstractRing for Complex<N>

Implementors§