Class AbstractField<T extends NativeOperators<T>>

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractField()
      Create an instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T add​(T a, T b)
      Add the elements.
      T divide​(T a, T b)
      Divide the element a by b.
      T multiply​(int n, T a)
      Multiply the element a by a specified number of times n.
      T multiply​(T a, T b)
      Multiply the elements.
      T negate​(T a)
      Negate the element.
      T reciprocal​(T a)
      Return the reciprocal (multiplicative inverse).
      T subtract​(T a, T b)
      Subtract the element b from a.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.commons.numbers.field.Field

        one, zero
    • Constructor Detail

      • AbstractField

        public AbstractField()
        Create an instance.
    • Method Detail

      • add

        public T add​(T a,
                     T b)
        Add the elements.
        Specified by:
        add in interface Field<T extends NativeOperators<T>>
        Parameters:
        a - Field element.
        b - Field element.
        Returns:
        a + b.
      • subtract

        public T subtract​(T a,
                          T b)
        Subtract the element b from a.
        Specified by:
        subtract in interface Field<T extends NativeOperators<T>>
        Parameters:
        a - Field element.
        b - Field element.
        Returns:
        a - b.
      • negate

        public T negate​(T a)
        Negate the element.
        Specified by:
        negate in interface Field<T extends NativeOperators<T>>
        Parameters:
        a - Field element.
        Returns:
        -a.
      • multiply

        public T multiply​(int n,
                          T a)
        Multiply the element a by a specified number of times n.
        Specified by:
        multiply in interface Field<T extends NativeOperators<T>>
        Parameters:
        n - Number of times a must be added to itself.
        a - Field element.
        Returns:
        n a.
      • multiply

        public T multiply​(T a,
                          T b)
        Multiply the elements.
        Specified by:
        multiply in interface Field<T extends NativeOperators<T>>
        Parameters:
        a - Field element.
        b - Field element.
        Returns:
        a * b.
      • divide

        public T divide​(T a,
                        T b)
        Divide the element a by b.
        Specified by:
        divide in interface Field<T extends NativeOperators<T>>
        Parameters:
        a - Field element.
        b - Field element.
        Returns:
        a * b-1.
      • reciprocal

        public T reciprocal​(T a)
        Return the reciprocal (multiplicative inverse).
        Specified by:
        reciprocal in interface Field<T extends NativeOperators<T>>
        Parameters:
        a - Field element.
        Returns:
        a-1.