Interface EuclideanDomain<E>

Type Parameters:
E - Element type.
All Superinterfaces:
AdditiveGroup<E>, CommutativeMonoid<E>, Monoid<E>, Ring<E>, Semigroup<E>, SemiRing<E>, Set<E>
All Known Implementing Classes:
BigIntegers, Integers, MultivariatePolynomialRing, PolynomialRing, PolynomialRingKaratsuba, TestUtils.TestBigIntegers, TestUtils.TestIntegers

public interface EuclideanDomain<E> extends Ring<E>
A Euclidean domain is a ring with Euclidean division.
  • Method Summary

    Modifier and Type
    Method
    Description
    default E
    abs(E a, Comparator<E> ordering)
    Return a if a ≥ 0 according to the given ordering, otherwise return -a.
    default Pair<E,E>
    divide(E a, int b)
    Returns a pair (q, r) such that a = qb + r and 0 ≤ f(r) < f(b) where f is the Euclidean function (see norm(E) for this domain.
    divide(E a, E b)
    Returns a pair (q, r) such that a = qb + r and 0 ≤ f(r) < f(b) where f is the Euclidean function (see norm(E) for this domain.
    default E
    divideExact(E a, int b)
    Compute a/b and throw and exception if the division is not exact.
    default E
    divideExact(E a, E b)
    Compute a/b and throw and exception if the division is not exact.
    default boolean
    divides(E a, E b)
     
    default E
    mod(E a, int m)
     
    default E
    mod(E a, E m)
     
    norm(E a)
    The euclidean function is a multiplicative map that maps elements of the domain to the integers and is used in the division of divide(E, E).

    Methods inherited from interface dk.jonaslindstrom.ruffini.common.abstractions.AdditiveGroup

    doubling, isZero, negate, scale, scale, subtract, sum

    Methods inherited from interface dk.jonaslindstrom.ruffini.common.abstractions.CommutativeMonoid

    add, add, add, zero

    Methods inherited from interface dk.jonaslindstrom.ruffini.common.abstractions.Monoid

    identity, isIdentity, power

    Methods inherited from interface dk.jonaslindstrom.ruffini.common.abstractions.Semigroup

    multiply, multiply, multiply

    Methods inherited from interface dk.jonaslindstrom.ruffini.common.abstractions.SemiRing

    integer, multiply, multiply

    Methods inherited from interface dk.jonaslindstrom.ruffini.common.abstractions.Set

    equals, toString
  • Method Details

    • divide

      Pair<E,E> divide(E a, E b)
      Returns a pair (q, r) such that a = qb + r and 0 ≤ f(r) < f(b) where f is the Euclidean function (see norm(E) for this domain.
    • divide

      default Pair<E,E> divide(E a, int b)
      Returns a pair (q, r) such that a = qb + r and 0 ≤ f(r) < f(b) where f is the Euclidean function (see norm(E) for this domain.
    • divideExact

      default E divideExact(E a, E b)
      Compute a/b and throw and exception if the division is not exact.
    • divideExact

      default E divideExact(E a, int b)
      Compute a/b and throw and exception if the division is not exact.
    • mod

      default E mod(E a, E m)
    • mod

      default E mod(E a, int m)
    • abs

      default E abs(E a, Comparator<E> ordering)
      Return a if a ≥ 0 according to the given ordering, otherwise return -a.
    • norm

      BigInteger norm(E a)
      The euclidean function is a multiplicative map that maps elements of the domain to the integers and is used in the division of divide(E, E).
    • divides

      default boolean divides(E a, E b)