Interface FieldElement<T extends FieldElement<T>>

    • Method Detail

      • getReal

        double getReal()
        Get the real value of the number.
        Returns:
        real value
      • negate

        T negate()
        Returns the additive inverse of this element.
        Returns:
        the opposite of this.
      • multiply

        T multiply​(int n)
        Compute n × this. Multiplication by an integer number is defined as the following sum \[ n \times \mathrm{this} = \sum_{i=1}^n \mathrm{this} \]
        Parameters:
        n - Number of times this must be added to itself.
        Returns:
        A new element representing n × this.
      • getField

        Field<T> getField()
        Get the Field to which the instance belongs.
        Returns:
        Field to which the instance belongs
      • isZero

        default boolean isZero()
        Check if an element is semantically equal to zero.

        The default implementation simply calls equals(getField().getZero()). However, this may need to be overridden in some cases as due to compatibility with hashCode() some classes implements equals(Object) in such a way that -0.0 and +0.0 are different, which may be a problem. It prevents for example identifying a diagonal element is zero and should be avoided when doing partial pivoting in LU decomposition.

        Returns:
        true if the element is semantically equal to zero
        Since:
        1.8