commons-math3-3.6.1-org.apache.commons.math3.RealFieldElement<T>-中英对照文档及源码赏析

commons-math3-3.6.1-org.apache.commons.math3.RealFieldElement<T>-中英对照文档及源码赏析

完整中文文档、中英对照文档下载请移步:commons-math3-中文文档、中英对照文档-CSDN下载

1. 开源组件说明

commonsmath.gif

commonslogo.png

jar包名称:commons-math3-3.6.1.jar

Maven 依赖:

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-math3</artifactId>
    <version>3.6.1</version>
</dependency>

完整中文文档、中英对照文档下载请移步:commons-math3-中文文档、中英对照文档-CSDN下载

本文介绍的类名:org.apache.commons.math3.RealFieldElement<T>

2. RealFieldElement<T> 中文-英语对照文档

org.apache.commons.math3

接口 RealFieldElement<T>

  • Type Parameters:
    T - the type of the field elements

    t - 现场元素的类型

    All Superinterfaces:
    FieldElement<T>

    FieldElement

    All Known Implementing Classes:
    Decimal64, DerivativeStructure, Dfp, DfpDec, SparseGradient

    DECIMAL64,DerivativeStucture,DFP,DFPDEC,SparseGradient



    public interface RealFieldElement<T>
    extends FieldElement<T>
    Interface representing a real field.

    代表真实字段的界面。

    从以下版本开始:
    3.2

    3.2

    另请参阅:
    FieldElement

    FieldElement.

    • 方法概要

      Methods  
      限定符和类型方法和说明
      Tabs()
      absolute value.

      绝对值。

      Tacos()
      Arc cosine operation.

      弧余弦操作。

      Tacosh()
      Inverse hyperbolic cosine operation.

      反向双曲余弦操作。

      Tadd(double a)
      '+' operator.

      '+'运营商。

      Tasin()
      Arc sine operation.

      电弧正弦操作。

      Tasinh()
      Inverse hyperbolic sine operation.

      反转双曲正弦操作。

      Tatan()
      Arc tangent operation.

      电弧切线操作。

      Tatan2(T x)
      Two arguments arc tangent operation.

      两个参数arc切线操作。

      Tatanh()
      Inverse hyperbolic tangent operation.

      反向双曲线切线操作。

      Tcbrt()
      Cubic root.

      立方根。

      Tceil()
      Get the smallest whole number larger than instance.

      获得比实例大的最小整数。

      TcopySign(double sign)
      Returns the instance with the sign of the argument.

      使用参数的符号返回实例。

      TcopySign(T sign)
      Returns the instance with the sign of the argument.

      使用参数的符号返回实例。

      Tcos()
      Cosine operation.

      余弦运行。

      Tcosh()
      Hyperbolic cosine operation.

      双曲线余弦操作。

      Tdivide(double a)
      '÷' operator.

      '÷'运营商。

      Texp()
      Exponential.

      指数。

      Texpm1()
      Exponential minus 1.

      指数减去1。

      Tfloor()
      Get the largest whole number smaller than instance.

      获得比实例小的最大数量。

      doublegetReal()
      Get the real value of the number.

      获得数字的实际值。

      Thypot(T y)
      Returns the hypotenuse of a triangle with sides this and y - sqrt( this 2 + y 2) avoiding intermediate overflow or underflow.

      返回三角形的斜边,与侧面和Y - SQRT(This2 + Y2)避免中间溢出或下溢。

      TlinearCombination(double[] a, T[] b)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(double a1, T b1, double a2, T b2)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(double a1, T b1, double a2, T b2, double a3, T b3)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(T[] a, T[] b)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(T a1, T b1, T a2, T b2)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(T a1, T b1, T a2, T b2, T a3, T b3)
      Compute a linear combination.

      计算线性组合。

      TlinearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4)
      Compute a linear combination.

      计算线性组合。

      Tlog()
      Natural logarithm.

      自然对数。

      Tlog1p()
      Shifted natural logarithm.

      移动自然对数。

      Tmultiply(double a)
      '×' operator.

      '×'算子。

      Tpow(double p)
      Power operation.

      电源操作。

      Tpow(int n)
      Integer power operation.

      整数电源操作。

      Tpow(T e)
      Power operation.

      电源操作。

      Treciprocal()
      Returns the multiplicative inverse of this element.

      返回此元素的乘法倒数。

      Tremainder(double a)
      IEEE remainder operator.

      IEEE剩余的运营商。

      Tremainder(T a)
      IEEE remainder operator.

      IEEE剩余的运营商。

      Trint()
      Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.

      获取最接近实例的整个数字,或者如果x在两个整数之间正好一半。

      TrootN(int n)
      N th root.

      第n根。

      longround()
      Get the closest long to instance value.

      获得最接近的时间达实例值。

      Tscalb(int n)
      Multiply the instance by a power of 2.

      将实例乘以2的功率。

      Tsignum()
      Compute the signum of the instance.

      计算实例的Signum。

      Tsin()
      Sine operation.

      正弦操作。

      Tsinh()
      Hyperbolic sine operation.

      双曲正弦操作。

      Tsqrt()
      Square root.

      平方根。

      Tsubtract(double a)
      '-' operator.

      '-' 操作员。

      Ttan()
      Tangent operation.

      切线操作。

      Ttanh()
      Hyperbolic tangent operation.

      双曲线切线操作。

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

        add, divide, getField, multiply, multiply, negate, subtract
    • 方法详细说明

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

        获得数字的实际值。

        返回:
        real value

        实际价值

      • add
        T add(double a)
        '+' operator.

        '+'运营商。

        参数:
        a - right hand side parameter of the operator

        操作员的右手侧参数

        返回:
        this+a

        这个+ A.

      • subtract
        T subtract(double a)
        '-' operator.

        '-' 操作员。

        参数:
        a - right hand side parameter of the operator

        操作员的右手侧参数

        返回:
        this-a

        这是

      • multiply
        T multiply(double a)
        '×' operator.

        '×'算子。

        参数:
        a - right hand side parameter of the operator

        操作员的右手侧参数

        返回:
        this×a

        这个×A.

      • divide
        T divide(double a)
        '÷' operator.

        '÷'运营商。

        参数:
        a - right hand side parameter of the operator

        操作员的右手侧参数

        返回:
        this÷a

        这个÷啊

      • remainder
        T remainder(double a)
        IEEE remainder operator.

        IEEE剩余的运营商。

        参数:
        a - right hand side parameter of the operator

        操作员的右手侧参数

        返回:
        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)

        这个 - n×a其中n是最接近的整数/ a(如果这个/ a在两个整数之间是半途的,则选择偶数整数)

      • remainder
        T remainder(T a)
                    throws DimensionMismatchException
        IEEE remainder operator.

        IEEE剩余的运营商。

        参数:
        a - right hand side parameter of the operator

        操作员的右手侧参数

        返回:
        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)

        这个 - n×a其中n是最接近的整数/ a(如果这个/ a在两个整数之间是半途的,则选择偶数整数)

        抛出:
        DimensionMismatchException - if number of free parameters or orders are inconsistent

        DimensionMismatchException - 如果免费参数或订单的数量不一致

      • abs
        T abs()
        absolute value.

        绝对值。

        返回:
        abs(this)

        ABS(这)

      • ceil
        T ceil()
        Get the smallest whole number larger than instance.

        获得比实例大的最小整数。

        返回:
        ceil(this)

        CEIL(这)

      • floor
        T floor()
        Get the largest whole number smaller than instance.

        获得比实例小的最大数量。

        返回:
        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.

        获取最接近实例的整个数字,或者如果x在两个整数之间正好一半。

        返回:
        a double number r such that r is an integer r - 0.5 ≤ this ≤ r + 0.5

        双数R,使R是整数R - 0.5≤这≤R+ 0.5

      • round
        long round()
        Get the closest long to instance value.

        获得最接近的时间达实例值。

        返回:
        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

        计算实例的Signum。Signum为-1用于负数,+1为正数,否则为0

        返回:
        -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a

        -1.0,-0.0,+0.0,+1.0或NaN取决于a的标志

      • copySign
        T copySign(T sign)
        Returns the instance with the sign of the argument. A NaN sign argument is treated as positive.

        使用参数的符号返回实例。NAN标志论证被视为积极。

        参数:
        sign - the sign for the returned value

        签署 - 返回值的标志

        返回:
        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.

        使用参数的符号返回实例。NAN标志论证被视为积极。

        参数:
        sign - the sign for the returned value

        签署 - 返回值的标志

        返回:
        the instance with the same sign as the sign argument

        具有与标志参数相同的符号的实例

      • scalb
        T scalb(int n)
        Multiply the instance by a power of 2.

        将实例乘以2的功率。

        参数:
        n - power of 2

        n - 力量为2

        返回:
        this × 2 n

        这个×2n.

      • hypot
        T hypot(T y)
                throws DimensionMismatchException
        Returns the hypotenuse of a triangle with sides this and y - sqrt( this 2 + y 2) 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.

        返回三角形的斜边,与侧面和Y - SQRT(This2 + Y2)避免中间溢出或下溢。如果任一参数是无限的,那么结果是正无穷大。否则,如果任一参数是NaN,那么结果是NaN。

        参数:
        y - a value

        y - 一个值

        返回:
        sqrt( this 2 + y 2)

        SQRT(this2 + y2)

        抛出:
        DimensionMismatchException - if number of free parameters or orders are inconsistent

        DimensionMismatchException - 如果免费参数或订单的数量不一致

      • reciprocal
        T reciprocal()
        Returns the multiplicative inverse of this element.

        返回此元素的乘法倒数。

        指定者:
        reciprocal in interface  FieldElement<T>

        互联互联器FieldElement

        返回:
        the inverse of this.

        这方面的反向。

      • sqrt
        T sqrt()
        Square root.

        平方根。

        返回:
        square root of the instance

        实例的平方根

      • cbrt
        T cbrt()
        Cubic root.

        立方根。

        返回:
        cubic root of the instance

        实例的立方根

      • rootN
        T rootN(int n)
        N th root.

        第n根。

        参数:
        n - order of the root

        n - root的顺序

        返回:
        n th root of the instance

        实例的第n个根

      • pow
        T pow(double p)
        Power operation.

        电源操作。

        参数:
        p - power to apply

        P - 申请权力

        返回:
        this p

        这个

      • pow
        T pow(int n)
        Integer power operation.

        整数电源操作。

        参数:
        n - power to apply

        n - 申请的力量

        返回:
        this n

        本来

      • pow
        T pow(T e)
              throws DimensionMismatchException
        Power operation.

        电源操作。

        参数:
        e - exponent

        E - 指数

        返回:
        this e

        这件事

        抛出:
        DimensionMismatchException - if number of free parameters or orders are inconsistent

        DimensionMismatchException - 如果免费参数或订单的数量不一致

      • exp
        T exp()
        Exponential.

        指数。

        返回:
        exponential of the instance

        实例的指数

      • expm1
        T expm1()
        Exponential minus 1.

        指数减去1。

        返回:
        exponential minus one of the instance

        指数减去其中一个实例

      • log
        T log()
        Natural logarithm.

        自然对数。

        返回:
        logarithm of the instance

        实例的对数

      • log1p
        T log1p()
        Shifted natural logarithm.

        移动自然对数。

        返回:
        logarithm of one plus the instance

        一个加上实例的对数

      • cos
        T cos()
        Cosine operation.

        余弦运行。

        返回:
        cos(this)

        Cos(这)

      • sin
        T sin()
        Sine operation.

        正弦操作。

        返回:
        sin(this)

        罪(这)

      • tan
        T tan()
        Tangent operation.

        切线操作。

        返回:
        tan(this)

        棕褐色(这)

      • acos
        T acos()
        Arc cosine operation.

        弧余弦操作。

        返回:
        acos(this)

        ACOS(这)

      • asin
        T asin()
        Arc sine operation.

        电弧正弦操作。

        返回:
        asin(this)

        asin(这)

      • atan
        T atan()
        Arc tangent operation.

        电弧切线操作。

        返回:
        atan(this)

        atan(这)

      • atan2
        T atan2(T x)
                throws DimensionMismatchException
        Two arguments arc tangent operation.

        两个参数arc切线操作。

        参数:
        x - second argument of the arc tangent

        X - 弧形切线的第二个论点

        返回:
        atan2(this, x)

        atan2(这个,x)

        抛出:
        DimensionMismatchException - if number of free parameters or orders are inconsistent

        DimensionMismatchException - 如果免费参数或订单的数量不一致

      • cosh
        T cosh()
        Hyperbolic cosine operation.

        双曲线余弦操作。

        返回:
        cosh(this)

        Cosh(这个)

      • sinh
        T sinh()
        Hyperbolic sine operation.

        双曲正弦操作。

        返回:
        sinh(this)

        sinh(这)

      • tanh
        T tanh()
        Hyperbolic tangent operation.

        双曲线切线操作。

        返回:
        tanh(this)

        Tanh(这个)

      • acosh
        T acosh()
        Inverse hyperbolic cosine operation.

        反向双曲余弦操作。

        返回:
        acosh(this)

        Acosh(这个)

      • asinh
        T asinh()
        Inverse hyperbolic sine operation.

        反转双曲正弦操作。

        返回:
        asin(this)

        asin(这)

      • atanh
        T atanh()
        Inverse hyperbolic tangent operation.

        反向双曲线切线操作。

        返回:
        atanh(this)

        atanh(这)

      • linearCombination
        T linearCombination(T[] a,
                          T[] b)
                            throws DimensionMismatchException
        Compute a linear combination.

        计算线性组合。

        参数:
        a - Factors.

        a - 因素。

        b - Factors.

        B - 因素。

        返回:
        Σi ai bi.

        Σiai bi。

        抛出:
        DimensionMismatchException - if arrays dimensions don't match

        DimensionMismatchException - 如果阵列尺寸不匹配

        从以下版本开始:
        3.2

        3.2

      • linearCombination
        T linearCombination(double[] a,
                          T[] b)
                            throws DimensionMismatchException
        Compute a linear combination.

        计算线性组合。

        参数:
        a - Factors.

        a - 因素。

        b - Factors.

        B - 因素。

        返回:
        Σi ai bi.

        Σiai bi。

        抛出:
        DimensionMismatchException - if arrays dimensions don't match

        DimensionMismatchException - 如果阵列尺寸不匹配

        从以下版本开始:
        3.2

        3.2

      • linearCombination
        T linearCombination(T a1,
                          T b1,
                          T a2,
                          T b2)
        Compute a linear combination.

        计算线性组合。

        参数:
        a1 - first factor of the first term

        A1 - 第一项的第一因素

        b1 - second factor of the first term

        B1 - 第一个术语的第二个因素

        a2 - first factor of the second term

        A2 - 第二项的第一因素

        b2 - second factor of the second term

        B2 - 第二项的第二个因素

        返回:
        a 1×b 1 + a 2×b 2

        A1×B1 + A2×B2

        从以下版本开始:
        3.2

        3.2

        另请参阅:
        linearCombination(Object, Object, Object, Object, Object, Object), linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)

        Linearcomination(对象,对象,对象,对象,对象,对象),linearcomination(对象,对象,对象,对象,对象,对象,对象,对象)

      • linearCombination
        T linearCombination(double a1,
                          T b1,
                          double a2,
                          T b2)
        Compute a linear combination.

        计算线性组合。

        参数:
        a1 - first factor of the first term

        A1 - 第一项的第一因素

        b1 - second factor of the first term

        B1 - 第一个术语的第二个因素

        a2 - first factor of the second term

        A2 - 第二项的第一因素

        b2 - second factor of the second term

        B2 - 第二项的第二个因素

        返回:
        a 1×b 1 + a 2×b 2

        A1×B1 + A2×B2

        从以下版本开始:
        3.2

        3.2

        另请参阅:
        linearCombination(double, Object, double, Object, double, Object), linearCombination(double, Object, double, Object, double, Object, double, Object)

        线性组合(双,对象,双,对象,双,对象),线性组合(双,对象,双,对象,双,对象,双,对象)

      • linearCombination
        T linearCombination(T a1,
                          T b1,
                          T a2,
                          T b2,
                          T a3,
                          T b3)
        Compute a linear combination.

        计算线性组合。

        参数:
        a1 - first factor of the first term

        A1 - 第一项的第一因素

        b1 - second factor of the first term

        B1 - 第一个术语的第二个因素

        a2 - first factor of the second term

        A2 - 第二项的第一因素

        b2 - second factor of the second term

        B2 - 第二项的第二个因素

        a3 - first factor of the third term

        A3 - 第三个术语的第一因素

        b3 - second factor of the third term

        B3 - 第三个术语的第二个因素

        返回:
        a 1×b 1 + a 2×b 2 + a 3×b 3

        A1×B1 + A2×B2 + A3×B3

        从以下版本开始:
        3.2

        3.2

        另请参阅:
        linearCombination(Object, Object, Object, Object), linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)

        Linearcomination(对象,对象,对象,对象),linearcombination(对象,对象,对象,对象,对象,对象,对象,对象)

      • linearCombination
        T linearCombination(double a1,
                          T b1,
                          double a2,
                          T b2,
                          double a3,
                          T b3)
        Compute a linear combination.

        计算线性组合。

        参数:
        a1 - first factor of the first term

        A1 - 第一项的第一因素

        b1 - second factor of the first term

        B1 - 第一个术语的第二个因素

        a2 - first factor of the second term

        A2 - 第二项的第一因素

        b2 - second factor of the second term

        B2 - 第二项的第二个因素

        a3 - first factor of the third term

        A3 - 第三个术语的第一因素

        b3 - second factor of the third term

        B3 - 第三个术语的第二个因素

        返回:
        a 1×b 1 + a 2×b 2 + a 3×b 3

        A1×B1 + A2×B2 + A3×B3

        从以下版本开始:
        3.2

        3.2

        另请参阅:
        linearCombination(double, Object, double, Object), linearCombination(double, Object, double, Object, double, Object, double, Object)

        线性组合(双,对象,双,对象),线性组合(双,对象,双,对象,双,对象,双,对象)

      • linearCombination
        T linearCombination(T a1,
                          T b1,
                          T a2,
                          T b2,
                          T a3,
                          T b3,
                          T a4,
                          T b4)
        Compute a linear combination.

        计算线性组合。

        参数:
        a1 - first factor of the first term

        A1 - 第一项的第一因素

        b1 - second factor of the first term

        B1 - 第一个术语的第二个因素

        a2 - first factor of the second term

        A2 - 第二项的第一因素

        b2 - second factor of the second term

        B2 - 第二项的第二个因素

        a3 - first factor of the third term

        A3 - 第三个术语的第一因素

        b3 - second factor of the third term

        B3 - 第三个术语的第二个因素

        a4 - first factor of the third term

        A4 - 第三个术语的第一因素

        b4 - second factor of the third term

        B4 - 第三个任期的第二个因素

        返回:
        a 1×b 1 + a 2×b 2 + a 3×b 3 + a 4×b 4

        A1×B1 + A2×B2 + A3×B3 + A4×B4

        从以下版本开始:
        3.2

        3.2

        另请参阅:
        linearCombination(Object, Object, Object, Object), linearCombination(Object, Object, Object, Object, Object, Object)

        Linearcomination(对象,对象,对象,对象),linearcomination(对象,对象,对象,对象,对象,对象)

      • linearCombination
        T linearCombination(double a1,
                          T b1,
                          double a2,
                          T b2,
                          double a3,
                          T b3,
                          double a4,
                          T b4)
        Compute a linear combination.

        计算线性组合。

        参数:
        a1 - first factor of the first term

        A1 - 第一项的第一因素

        b1 - second factor of the first term

        B1 - 第一个术语的第二个因素

        a2 - first factor of the second term

        A2 - 第二项的第一因素

        b2 - second factor of the second term

        B2 - 第二项的第二个因素

        a3 - first factor of the third term

        A3 - 第三个术语的第一因素

        b3 - second factor of the third term

        B3 - 第三个术语的第二个因素

        a4 - first factor of the third term

        A4 - 第三个术语的第一因素

        b4 - second factor of the third term

        B4 - 第三个任期的第二个因素

        返回:
        a 1×b 1 + a 2×b 2 + a 3×b 3 + a 4×b 4

        A1×B1 + A2×B2 + A3×B3 + A4×B4

        从以下版本开始:
        3.2

        3.2

        另请参阅:
        linearCombination(double, Object, double, Object), linearCombination(double, Object, double, Object, double, Object)

        线性组合(双,对象,双,对象),线性组合(双,对象,双,对象,双,对象)

3. 源码赏析

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.math3;

import org.apache.commons.math3.exception.DimensionMismatchException;

/**
 * Interface representing a <a href="http://mathworld.wolfram.com/RealNumber.html">real</a>
 * <a href="http://mathworld.wolfram.com/Field.html">field</a>.
 * @param <T> the type of the field elements
 * @see FieldElement
 * @since 3.2
 */
public interface RealFieldElement<T> extends FieldElement<T> {

    /** Get the real value of the number.
     * @return real value
     */
    double getReal();

    /** '+' operator.
     * @param a right hand side parameter of the operator
     * @return this+a
     */
    T add(double a);

    /** '-' operator.
     * @param a right hand side parameter of the operator
     * @return this-a
     */
    T subtract(double a);

    /** '&times;' operator.
     * @param a right hand side parameter of the operator
     * @return this&times;a
     */
    T multiply(double a);

    /** '&divide;' operator.
     * @param a right hand side parameter of the operator
     * @return this&divide;a
     */
    T divide(double a);

    /** IEEE remainder operator.
     * @param a right hand side parameter of the operator
     * @return this - n &times; 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)
     */
    T remainder(double a);

    /** IEEE remainder operator.
     * @param a right hand side parameter of the operator
     * @return this - n &times; 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)
     * @exception DimensionMismatchException if number of free parameters or orders are inconsistent
     */
    T remainder(T a)
        throws DimensionMismatchException;

    /** absolute value.
     * @return abs(this)
     */
    T abs();

    /** Get the smallest whole number larger than instance.
     * @return ceil(this)
     */
    T ceil();

    /** Get the largest whole number smaller than instance.
     * @return floor(this)
     */
    T floor();

    /** Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers.
     * @return a double number r such that r is an integer r - 0.5 &le; this &le; r + 0.5
     */
    T rint();

    /** Get the closest long to instance value.
     * @return closest long to {@link #getReal()}
     */
    long round();

    /** Compute the signum of the instance.
     * The signum is -1 for negative numbers, +1 for positive numbers and 0 otherwise
     * @return -1.0, -0.0, +0.0, +1.0 or NaN depending on sign of a
     */
    T signum();

    /**
     * Returns the instance with the sign of the argument.
     * A NaN {@code sign} argument is treated as positive.
     *
     * @param sign the sign for the returned value
     * @return the instance with the same sign as the {@code sign} argument
     */
    T copySign(T sign);

    /**
     * Returns the instance with the sign of the argument.
     * A NaN {@code sign} argument is treated as positive.
     *
     * @param sign the sign for the returned value
     * @return the instance with the same sign as the {@code sign} argument
     */
    T copySign(double sign);

    /**
     * Multiply the instance by a power of 2.
     * @param n power of 2
     * @return this &times; 2<sup>n</sup>
     */
    T scalb(int n);

    /**
     * Returns the hypotenuse of a triangle with sides {@code this} and {@code y}
     * - sqrt(<i>this</i><sup>2</sup>&nbsp;+<i>y</i><sup>2</sup>)
     * avoiding intermediate overflow or underflow.
     *
     * <ul>
     * <li> If either argument is infinite, then the result is positive infinity.</li>
     * <li> else, if either argument is NaN then the result is NaN.</li>
     * </ul>
     *
     * @param y a value
     * @return sqrt(<i>this</i><sup>2</sup>&nbsp;+<i>y</i><sup>2</sup>)
     * @exception DimensionMismatchException if number of free parameters or orders are inconsistent
     */
    T hypot(T y)
        throws DimensionMismatchException;

    /** {@inheritDoc} */
    T reciprocal();

    /** Square root.
     * @return square root of the instance
     */
    T sqrt();

    /** Cubic root.
     * @return cubic root of the instance
     */
    T cbrt();

    /** N<sup>th</sup> root.
     * @param n order of the root
     * @return n<sup>th</sup> root of the instance
     */
    T rootN(int n);

    /** Power operation.
     * @param p power to apply
     * @return this<sup>p</sup>
     */
    T pow(double p);

    /** Integer power operation.
     * @param n power to apply
     * @return this<sup>n</sup>
     */
    T pow(int n);

    /** Power operation.
     * @param e exponent
     * @return this<sup>e</sup>
     * @exception DimensionMismatchException if number of free parameters or orders are inconsistent
     */
    T pow(T e)
        throws DimensionMismatchException;

    /** Exponential.
     * @return exponential of the instance
     */
    T exp();

    /** Exponential minus 1.
     * @return exponential minus one of the instance
     */
    T expm1();

    /** Natural logarithm.
     * @return logarithm of the instance
     */
    T log();

    /** Shifted natural logarithm.
     * @return logarithm of one plus the instance
     */
    T log1p();

//    TODO: add this method in 4.0, as it is not possible to do it in 3.2
//          due to incompatibility of the return type in the Dfp class
//    /** Base 10 logarithm.
//     * @return base 10 logarithm of the instance
//     */
//    T log10();

    /** Cosine operation.
     * @return cos(this)
     */
    T cos();

    /** Sine operation.
     * @return sin(this)
     */
    T sin();

    /** Tangent operation.
     * @return tan(this)
     */
    T tan();

    /** Arc cosine operation.
     * @return acos(this)
     */
    T acos();

    /** Arc sine operation.
     * @return asin(this)
     */
    T asin();

    /** Arc tangent operation.
     * @return atan(this)
     */
    T atan();

    /** Two arguments arc tangent operation.
     * @param x second argument of the arc tangent
     * @return atan2(this, x)
     * @exception DimensionMismatchException if number of free parameters or orders are inconsistent
     */
    T atan2(T x)
        throws DimensionMismatchException;

    /** Hyperbolic cosine operation.
     * @return cosh(this)
     */
    T cosh();

    /** Hyperbolic sine operation.
     * @return sinh(this)
     */
    T sinh();

    /** Hyperbolic tangent operation.
     * @return tanh(this)
     */
    T tanh();

    /** Inverse hyperbolic cosine operation.
     * @return acosh(this)
     */
    T acosh();

    /** Inverse hyperbolic sine operation.
     * @return asin(this)
     */
    T asinh();

    /** Inverse hyperbolic  tangent operation.
     * @return atanh(this)
     */
    T atanh();

    /**
     * Compute a linear combination.
     * @param a Factors.
     * @param b Factors.
     * @return <code>&Sigma;<sub>i</sub> a<sub>i</sub> b<sub>i</sub></code>.
     * @throws DimensionMismatchException if arrays dimensions don't match
     * @since 3.2
     */
    T linearCombination(T[] a, T[] b)
        throws DimensionMismatchException;

    /**
     * Compute a linear combination.
     * @param a Factors.
     * @param b Factors.
     * @return <code>&Sigma;<sub>i</sub> a<sub>i</sub> b<sub>i</sub></code>.
     * @throws DimensionMismatchException if arrays dimensions don't match
     * @since 3.2
     */
    T linearCombination(double[] a, T[] b)
        throws DimensionMismatchException;

    /**
     * Compute a linear combination.
     * @param a1 first factor of the first term
     * @param b1 second factor of the first term
     * @param a2 first factor of the second term
     * @param b2 second factor of the second term
     * @return a<sub>1</sub>&times;b<sub>1</sub> +
     * a<sub>2</sub>&times;b<sub>2</sub>
     * @see #linearCombination(Object, Object, Object, Object, Object, Object)
     * @see #linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
     * @since 3.2
     */
    T linearCombination(T a1, T b1, T a2, T b2);

    /**
     * Compute a linear combination.
     * @param a1 first factor of the first term
     * @param b1 second factor of the first term
     * @param a2 first factor of the second term
     * @param b2 second factor of the second term
     * @return a<sub>1</sub>&times;b<sub>1</sub> +
     * a<sub>2</sub>&times;b<sub>2</sub>
     * @see #linearCombination(double, Object, double, Object, double, Object)
     * @see #linearCombination(double, Object, double, Object, double, Object, double, Object)
     * @since 3.2
     */
    T linearCombination(double a1, T b1, double a2, T b2);

    /**
     * Compute a linear combination.
     * @param a1 first factor of the first term
     * @param b1 second factor of the first term
     * @param a2 first factor of the second term
     * @param b2 second factor of the second term
     * @param a3 first factor of the third term
     * @param b3 second factor of the third term
     * @return a<sub>1</sub>&times;b<sub>1</sub> +
     * a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub>
     * @see #linearCombination(Object, Object, Object, Object)
     * @see #linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
     * @since 3.2
     */
    T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3);

    /**
     * Compute a linear combination.
     * @param a1 first factor of the first term
     * @param b1 second factor of the first term
     * @param a2 first factor of the second term
     * @param b2 second factor of the second term
     * @param a3 first factor of the third term
     * @param b3 second factor of the third term
     * @return a<sub>1</sub>&times;b<sub>1</sub> +
     * a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub>
     * @see #linearCombination(double, Object, double, Object)
     * @see #linearCombination(double, Object, double, Object, double, Object, double, Object)
     * @since 3.2
     */
    T linearCombination(double a1, T b1,  double a2, T b2, double a3, T b3);

    /**
     * Compute a linear combination.
     * @param a1 first factor of the first term
     * @param b1 second factor of the first term
     * @param a2 first factor of the second term
     * @param b2 second factor of the second term
     * @param a3 first factor of the third term
     * @param b3 second factor of the third term
     * @param a4 first factor of the third term
     * @param b4 second factor of the third term
     * @return a<sub>1</sub>&times;b<sub>1</sub> +
     * a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> +
     * a<sub>4</sub>&times;b<sub>4</sub>
     * @see #linearCombination(Object, Object, Object, Object)
     * @see #linearCombination(Object, Object, Object, Object, Object, Object)
     * @since 3.2
     */
    T linearCombination(T a1, T b1, T a2, T b2, T a3, T b3, T a4, T b4);

    /**
     * Compute a linear combination.
     * @param a1 first factor of the first term
     * @param b1 second factor of the first term
     * @param a2 first factor of the second term
     * @param b2 second factor of the second term
     * @param a3 first factor of the third term
     * @param b3 second factor of the third term
     * @param a4 first factor of the third term
     * @param b4 second factor of the third term
     * @return a<sub>1</sub>&times;b<sub>1</sub> +
     * a<sub>2</sub>&times;b<sub>2</sub> + a<sub>3</sub>&times;b<sub>3</sub> +
     * a<sub>4</sub>&times;b<sub>4</sub>
     * @see #linearCombination(double, Object, double, Object)
     * @see #linearCombination(double, Object, double, Object, double, Object)
     * @since 3.2
     */
    T linearCombination(double a1, T b1, double a2, T b2, double a3, T b3, double a4, T b4);

}
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

寒水馨

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值