Trait alga::general::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.

Object Safety§

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>