Interface AbelianMonoid<E>

All Superinterfaces:
Magma<E>, Monoid<E>, Set<E>
All Known Subinterfaces:
AbelianGroup<E>, Algebra<E,F>, BanachAlgebra<E,F>, BanachSpace<E,S>, CStarAlgebra<E,F>, DivisionRing<E>, Field<E>, GradedAlgebra<E,F>, HilbertSpace<E,S>, KleeneAlgebra<E>, LieAlgebra<E,S>, Matrix<E>, Module<M,R>, NonAssociativeAlgebra<E,S>, Ring<E>, Semiring<E>, Vector<E>, VectorSpace<V,F>
All Known Implementing Classes:
Boolean, BooleanAlgebra, Booleans, CliffordAlgebra, Complex, Complexes, DenseMatrix, DenseVector, DoubleField, GenericMatrix, GenericVector, Integer, Integers, MatrixLieAlgebra, MMapMatrix, NativeRealBig, NativeRealDoubleMatrix, NativeRealDoubleVector, NativeRealFloatMatrix, Natural, Naturals, Octonion, Octonions, PolynomialRing, Quaternion, Quaternions, Rational, Rationals, Real, RealBig, RealDouble, RealDoubleMatrix, RealDoubleVector, RealFloat, RealFloatVector, Reals, SIMDRealDoubleMatrix, SIMDRealFloatMatrix, SparseMatrix, SparseVector, SquareMatrices, TiledMatrix, Vector2D, Vector3D, Vector4D, VectorND, VectorSpace2D, VectorSpace3D

public interface AbelianMonoid<E> extends Monoid<E>
An abelian monoid is a commutative monoid.

It satisfies all monoid axioms plus commutativity: a ∗ b = b ∗ a.

Convention: Abelian monoids often use additive notation (+, 0).

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Summary

    Modifier and Type
    Method
    Description
    default E
    add(E a, E b)
    Returns the sum of two elements (additive notation).
    default E
    Default implementation of identity that delegates to zero().
    default boolean
    Abelian monoids are commutative by definition.
    default E
    Returns the additive identity (zero element).

    Methods inherited from interface Magma

    operate

    Methods inherited from interface Monoid

    isAssociative

    Methods inherited from interface Set

    contains, description, isEmpty
  • Method Details

    • add

      default E add(E a, E b)
      Returns the sum of two elements (additive notation).

      Delegates to Magma.operate(Object, Object).

      Parameters:
      a - the first addend
      b - the second addend
      Returns:
      a + b
    • zero

      default E zero()
      Returns the additive identity (zero element).

      Delegates to identity().

      Returns:
      the zero element
    • isCommutative

      default boolean isCommutative()
      Abelian monoids are commutative by definition.
      Specified by:
      isCommutative in interface Magma<E>
      Returns:
      always true
    • identity

      default E identity()
      Default implementation of identity that delegates to zero(). Implementations can override zero() to provide the identity element.
      Specified by:
      identity in interface Monoid<E>
      Returns:
      the identity element (same as zero())