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:
- Commutativity:
a * b = b * afor alla, binG.
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§
impl AbelianGroup for f32
impl AbelianGroup for f64
impl AbelianGroup for i8
impl AbelianGroup for i16
impl AbelianGroup for i32
impl AbelianGroup for i64
impl AbelianGroup for i128
impl AbelianGroup for isize
impl AbelianGroup for u8
impl AbelianGroup for u16
impl AbelianGroup for u32
impl AbelianGroup for u64
impl AbelianGroup for u128
impl AbelianGroup for usize
Implementors§
impl AbelianGroup for Float106
impl<T: RealField> AbelianGroup for Complex<T>
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.