Interface RealFieldElement<T>

Type Parameters:
T - the type of the field elements
All Superinterfaces:
FieldElement<T>
All Known Implementing Classes:
Decimal64, DerivativeStructure, Dfp, DfpDec, SparseGradient

public interface RealFieldElement<T> extends FieldElement<T>
Interface representing a real field.
Since:
3.2
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    abs()
    absolute value.
    Arc cosine operation.
    Inverse hyperbolic cosine operation.
    add(double a)
    '+' operator.
    Arc sine operation.
    Inverse hyperbolic sine operation.
    Arc tangent operation.
    atan2(T x)
    Two arguments arc tangent operation.
    Inverse hyperbolic tangent operation.
    Cubic root.
    Get the smallest whole number larger than instance.
    copySign(double sign)
    Returns the instance with the sign of the argument.
    copySign(T sign)
    Returns the instance with the sign of the argument.
    cos()
    Cosine operation.
    Hyperbolic cosine operation.
    divide(double a)
    '÷' operator.
    exp()
    Exponential.
    Exponential minus 1.
    Get the largest whole number smaller than instance.
    double
    Get the real value of the number.
    hypot(T y)
    Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.
    linearCombination(double[] a, T[] b)
    Compute a linear combination.
    linearCombination(double a1, T b1, double a2, T b2)
    Compute a linear combination.
    linearCombination(double a1, T b1, double a2, T b2, double a3, T b3)
    Compute a linear combination.
    linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)
    Compute a linear combination.
    linearCombination(T[] a, T[] b)
    Compute a linear combination.
    linearCombination(T a1, T b1, T a2, T b2)
    Compute a linear combination.
    linearCombination(T a1, T b1, T a2, T b2, T a3, T b3)
    Compute a linear combination.
    linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)
    Compute a linear combination.
    log()
    Natural logarithm.
    Shifted natural logarithm.
    multiply(double a)
    '×' operator.
    pow(double p)
    Power operation.
    pow(int n)
    Integer power operation.
    pow(T e)
    Power operation.
    Returns the multiplicative inverse of this element.
    remainder(double a)
    IEEE remainder operator.
    IEEE remainder operator.
    Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
    rootN(int n)
    Nth root.
    long
    Get the closest long to instance value.
    scalb(int n)
    Multiply the instance by a power of 2.
    Compute the signum of the instance.
    sin()
    Sine operation.
    Hyperbolic sine operation.
    Square root.
    subtract(double a)
    '-' operator.
    tan()
    Tangent operation.
    Hyperbolic tangent operation.

    Methods inherited from interface org.apache.commons.math3.FieldElement

    add, divide, getField, multiply, multiply, negate, subtract
  • Method Details

    • getReal

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

      T add(double a)
      '+' operator.
      Parameters:
      a - right hand side parameter of the operator
      Returns:
      this+a
    • subtract

      T subtract(double a)
      '-' operator.
      Parameters:
      a - right hand side parameter of the operator
      Returns:
      this-a
    • multiply

      T multiply(double a)
      '×' operator.
      Parameters:
      a - right hand side parameter of the operator
      Returns:
      this×a
    • divide

      T divide(double a)
      '÷' operator.
      Parameters:
      a - right hand side parameter of the operator
      Returns:
      this÷a
    • remainder

      T remainder(double a)
      IEEE remainder operator.
      Parameters:
      a - right hand side parameter of the operator
      Returns:
      this - n × a where n is the closest integer to this/a (the even integer is chosen for n if this/a is halfway between two integers)
    • remainder

      T remainder(T a) throws DimensionMismatchException
      IEEE remainder operator.
      Parameters:
      a - right hand side parameter of the operator
      Returns:
      this - n × a where n is the closest integer to this/a (the even integer is chosen for n if this/a is halfway between two integers)
      Throws:
      DimensionMismatchException - if number of free parameters or orders are inconsistent
    • abs

      T abs()
      absolute value.
      Returns:
      abs(this)
    • ceil

      T ceil()
      Get the smallest whole number larger than instance.
      Returns:
      ceil(this)
    • floor

      T floor()
      Get the largest whole number smaller than instance.
      Returns:
      floor(this)
    • rint

      T rint()
      Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
      Returns:
      a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5
    • round

      long round()
      Get the closest long to instance value.
      Returns:
      closest long to getReal()
    • signum

      T signum()
      Compute the signum of the instance. The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise
      Returns:
      -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
    • copySign

      T copySign(T sign)
      Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
      Parameters:
      sign - the sign for the returned value
      Returns:
      the instance with the same sign as the sign argument
    • copySign

      T copySign(double sign)
      Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.
      Parameters:
      sign - the sign for the returned value
      Returns:
      the instance with the same sign as the sign argument
    • scalb

      T scalb(int n)
      Multiply the instance by a power of 2.
      Parameters:
      n - power of 2
      Returns:
      this × 2n
    • hypot

      T hypot(T y) throws DimensionMismatchException
      Returns the hypotenuse of a triangle with sides this and y - sqrt(this2 +y2) avoiding intermediate overflow or underflow.
      • If either argument is infinite, then the result is positive infinity.
      • else, if either argument is NaN then the result is NaN.
      Parameters:
      y - a value
      Returns:
      sqrt(this2 +y2)
      Throws:
      DimensionMismatchException - if number of free parameters or orders are inconsistent
    • reciprocal

      T reciprocal()
      Returns the multiplicative inverse of this element.
      Specified by:
      reciprocal in interface FieldElement<T>
      Returns:
      the inverse of this.
    • sqrt

      T sqrt()
      Square root.
      Returns:
      square root of the instance
    • cbrt

      T cbrt()
      Cubic root.
      Returns:
      cubic root of the instance
    • rootN

      T rootN(int n)
      Nth root.
      Parameters:
      n - order of the root
      Returns:
      nth root of the instance
    • pow

      T pow(double p)
      Power operation.
      Parameters:
      p - power to apply
      Returns:
      thisp
    • pow

      T pow(int n)
      Integer power operation.
      Parameters:
      n - power to apply
      Returns:
      thisn
    • pow

      Power operation.
      Parameters:
      e - exponent
      Returns:
      thise
      Throws:
      DimensionMismatchException - if number of free parameters or orders are inconsistent
    • exp

      T exp()
      Exponential.
      Returns:
      exponential of the instance
    • expm1

      T expm1()
      Exponential minus 1.
      Returns:
      exponential minus one of the instance
    • log

      T log()
      Natural logarithm.
      Returns:
      logarithm of the instance
    • log1p

      T log1p()
      Shifted natural logarithm.
      Returns:
      logarithm of one plus the instance
    • cos

      T cos()
      Cosine operation.
      Returns:
      cos(this)
    • sin

      T sin()
      Sine operation.
      Returns:
      sin(this)
    • tan

      T tan()
      Tangent operation.
      Returns:
      tan(this)
    • acos

      T acos()
      Arc cosine operation.
      Returns:
      acos(this)
    • asin

      T asin()
      Arc sine operation.
      Returns:
      asin(this)
    • atan

      T atan()
      Arc tangent operation.
      Returns:
      atan(this)
    • atan2

      T atan2(T x) throws DimensionMismatchException
      Two arguments arc tangent operation.
      Parameters:
      x - second argument of the arc tangent
      Returns:
      atan2(this, x)
      Throws:
      DimensionMismatchException - if number of free parameters or orders are inconsistent
    • cosh

      T cosh()
      Hyperbolic cosine operation.
      Returns:
      cosh(this)
    • sinh

      T sinh()
      Hyperbolic sine operation.
      Returns:
      sinh(this)
    • tanh

      T tanh()
      Hyperbolic tangent operation.
      Returns:
      tanh(this)
    • acosh

      T acosh()
      Inverse hyperbolic cosine operation.
      Returns:
      acosh(this)
    • asinh

      T asinh()
      Inverse hyperbolic sine operation.
      Returns:
      asin(this)
    • atanh

      T atanh()
      Inverse hyperbolic tangent operation.
      Returns:
      atanh(this)
    • linearCombination

      T linearCombination(T[] a, T[] b) throws DimensionMismatchException
      Compute a linear combination.
      Parameters:
      a - Factors.
      b - Factors.
      Returns:
      Σi ai bi.
      Throws:
      DimensionMismatchException - if arrays dimensions don't match
      Since:
      3.2
    • linearCombination

      T linearCombination(double[] a, T[] b) throws DimensionMismatchException
      Compute a linear combination.
      Parameters:
      a - Factors.
      b - Factors.
      Returns:
      Σi ai bi.
      Throws:
      DimensionMismatchException - if arrays dimensions don't match
      Since:
      3.2
    • linearCombination

      T linearCombination(T a1, T b1, T a2, T b2)
      Compute a linear combination.
      Parameters:
      a1 - first factor of the first term
      b1 - second factor of the first term
      a2 - first factor of the second term
      b2 - second factor of the second term
      Returns:
      a1×b1 + a2×b2
      Since:
      3.2
      See Also:
    • linearCombination

      T linearCombination(double a1, T b1, double a2, T b2)
      Compute a linear combination.
      Parameters:
      a1 - first factor of the first term
      b1 - second factor of the first term
      a2 - first factor of the second term
      b2 - second factor of the second term
      Returns:
      a1×b1 + a2×b2
      Since:
      3.2
      See Also:
    • linearCombination

      T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3)
      Compute a linear combination.
      Parameters:
      a1 - first factor of the first term
      b1 - second factor of the first term
      a2 - first factor of the second term
      b2 - second factor of the second term
      a3 - first factor of the third term
      b3 - second factor of the third term
      Returns:
      a1×b1 + a2×b2 + a3×b3
      Since:
      3.2
      See Also:
    • linearCombination

      T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3)
      Compute a linear combination.
      Parameters:
      a1 - first factor of the first term
      b1 - second factor of the first term
      a2 - first factor of the second term
      b2 - second factor of the second term
      a3 - first factor of the third term
      b3 - second factor of the third term
      Returns:
      a1×b1 + a2×b2 + a3×b3
      Since:
      3.2
      See Also:
    • linearCombination

      T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)
      Compute a linear combination.
      Parameters:
      a1 - first factor of the first term
      b1 - second factor of the first term
      a2 - first factor of the second term
      b2 - second factor of the second term
      a3 - first factor of the third term
      b3 - second factor of the third term
      a4 - first factor of the third term
      b4 - second factor of the third term
      Returns:
      a1×b1 + a2×b2 + a3×b3 + a4×b4
      Since:
      3.2
      See Also:
    • linearCombination

      T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)
      Compute a linear combination.
      Parameters:
      a1 - first factor of the first term
      b1 - second factor of the first term
      a2 - first factor of the second term
      b2 - second factor of the second term
      a3 - first factor of the third term
      b3 - second factor of the third term
      a4 - first factor of the third term
      b4 - second factor of the third term
      Returns:
      a1×b1 + a2×b2 + a3×b3 + a4×b4
      Since:
      3.2
      See Also: