alga::general

Trait AbstractMagma

Source
pub trait AbstractMagma<O: Operator>: Sized + Clone {
    // Required method
    fn operate(&self, right: &Self) -> Self;

    // Provided method
    fn op(&self, _: O, lhs: &Self) -> Self { ... }
}
Expand description

A magma is an algebraic structure which consists of a set equipped with a binary operation, ∘, which must be closed.

§Closed binary operation

a, b ∈ Self ⇒ a ∘ b ∈ Self

Required Methods§

Source

fn operate(&self, right: &Self) -> Self

Performs an operation.

Provided Methods§

Source

fn op(&self, _: O, lhs: &Self) -> Self

Performs specific operation.

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 AbstractMagma<Additive> for f32

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for f64

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for i8

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for i16

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for i32

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for i64

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for i128

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for isize

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for u8

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for u16

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for u32

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for u64

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for u128

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Additive> for usize

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for f32

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for f64

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for i8

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for i16

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for i32

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for i64

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for i128

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for isize

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for u8

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for u16

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for u32

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for u64

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for u128

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl AbstractMagma<Multiplicative> for usize

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl<N: Num + Clone> AbstractMagma<Multiplicative> for Complex<N>

Source§

fn operate(&self, lhs: &Self) -> Self

Source§

impl<N: AbstractMagma<Additive>> AbstractMagma<Additive> for Complex<N>

Source§

fn operate(&self, lhs: &Self) -> Self

Implementors§

Source§

impl<O: Operator> AbstractMagma<O> for Id<O>