Interface Field<T>

Type Parameters:
T - Type of the field elements.
All Known Implementing Classes:
AbstractField, BigFractionField, DDField, FP64Field, FractionField

public interface Field<T>
Interface representing a field.
  • Method Summary

    Modifier and Type
    Method
    Description
    add(T a, T b)
    Add the elements.
    divide(T a, T b)
    Divide the element a by b.
    multiply(int n, T a)
    Multiply the element a by a specified number of times n.
    multiply(T a, T b)
    Multiply the elements.
    negate(T a)
    Negate the element.
    one()
    Return the value of one.
    Return the reciprocal (multiplicative inverse).
    subtract(T a, T b)
    Subtract the element b from a.
    Return the value of zero.
  • Method Details

    • add

      T add(T a, T b)
      Add the elements.
      Parameters:
      a - Field element.
      b - Field element.
      Returns:
      a + b.
    • subtract

      T subtract(T a, T b)
      Subtract the element b from a.
      Parameters:
      a - Field element.
      b - Field element.
      Returns:
      a - b.
    • negate

      T negate(T a)
      Negate the element.
      Parameters:
      a - Field element.
      Returns:
      -a.
    • multiply

      T multiply(int n, T a)
      Multiply the element a by a specified number of times n.
      Parameters:
      n - Number of times a must be added to itself.
      a - Field element.
      Returns:
      n a.
    • multiply

      T multiply(T a, T b)
      Multiply the elements.
      Parameters:
      a - Field element.
      b - Field element.
      Returns:
      a * b.
    • divide

      T divide(T a, T b)
      Divide the element a by b.
      Parameters:
      a - Field element.
      b - Field element.
      Returns:
      a * b-1.
    • reciprocal

      T reciprocal(T a)
      Return the reciprocal (multiplicative inverse).
      Parameters:
      a - Field element.
      Returns:
      a-1.
    • one

      T one()
      Return the value of one.
      Returns:
      the field element 1 such that for all a, 1 * a == a.
    • zero

      T zero()
      Return the value of zero.
      Returns:
      the field element 0 such that for all a, 0 + a == a.