Skip to main content

AbelianGroup

Trait AbelianGroup 

Source
pub trait AbelianGroup: AddGroup { }
Expand description

A marker trait for an Abelian Group (also known as a Commutative Group).

An Abelian group is a Group where the binary operation is commutative. This means that the order of the operands does not affect the result.

§Mathematical Definition

A group (G, *) is Abelian if it satisfies the following additional law:

  1. Commutativity: a * b = b * a for all a, b in G.

Since this trait builds on AddGroup, the operation is +, and the law is a + b = b + a.

§Note on Implementation

This is a marker trait. It has no methods and provides no new functionality. Its purpose is to signal at the type level that the commutativity law holds. The compiler cannot verify this law, so implementing this trait is a promise by the developer that the underlying type’s addition operation is commutative.

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 AbelianGroup for f32

Source§

impl AbelianGroup for f64

Source§

impl AbelianGroup for i8

Source§

impl AbelianGroup for i16

Source§

impl AbelianGroup for i32

Source§

impl AbelianGroup for i64

Source§

impl AbelianGroup for i128

Source§

impl AbelianGroup for isize

Source§

impl AbelianGroup for u8

Source§

impl AbelianGroup for u16

Source§

impl AbelianGroup for u32

Source§

impl AbelianGroup for u64

Source§

impl AbelianGroup for u128

Source§

impl AbelianGroup for usize

Implementors§

Source§

impl AbelianGroup for Float106

Source§

impl<T: RealField> AbelianGroup for Complex<T>

Source§

impl<T: RealField> AbelianGroup for Octonion<T>

Implements the AbelianGroup trait for Octonion.

This signifies that Octonions form an abelian (commutative) group under addition. Addition is component-wise, ensuring commutativity and associativity.

Source§

impl<T: RealField> AbelianGroup for Quaternion<T>