Documentation of 'cc.redberry.core.number.Complex' Java class
Complex
cc.redberry.core.number

Class Complex

    • Field Detail

      • ComplexNaN

        public static final Complex ComplexNaN
      • REAL_POSITIVE_INFINITY

        public static final Complex REAL_POSITIVE_INFINITY
      • REAL_NEGATIVE_INFINITY

        public static final Complex REAL_NEGATIVE_INFINITY
      • IMAGINARY_POSITIVE_INFINITY

        public static final Complex IMAGINARY_POSITIVE_INFINITY
      • IMAGINARY_NEGATIVE_INFINITY

        public static final Complex IMAGINARY_NEGATIVE_INFINITY
      • COMPLEX_NEGATIVE_INFINITY

        public static final Complex COMPLEX_NEGATIVE_INFINITY
      • COMPLEX_POSITIVE_INFINITY

        public static final Complex COMPLEX_POSITIVE_INFINITY
      • COMPLEX_INFINITY

        public static final Complex COMPLEX_INFINITY
      • ZERO

        public static final Complex ZERO
      • ONE

        public static final Complex ONE
      • ONE_HALF

        public static final Complex ONE_HALF
      • TWO

        public static final Complex TWO
      • FOUR

        public static final Complex FOUR
      • MINUS_ONE

        public static final Complex MINUS_ONE
      • MINUS_ONE_HALF

        public static final Complex MINUS_ONE_HALF
      • MINUS_TWO

        public static final Complex MINUS_TWO
      • IMAGINARY_UNIT

        public static final Complex IMAGINARY_UNIT
      • NEGATIVE_IMAGINARY_UNIT

        public static final Complex NEGATIVE_IMAGINARY_UNIT
    • Constructor Detail

      • Complex

        public Complex(Real real,
                       Real imaginary)
      • Complex

        public Complex(Real real)
      • Complex

        public Complex(org.apache.commons.math3.complex.Complex complex)
      • Complex

        public Complex(int real,
                       int imaginary)
      • Complex

        public Complex(int real)
      • Complex

        public Complex(double real,
                       double imaginary)
      • Complex

        public Complex(int real,
                       double imaginary)
      • Complex

        public Complex(double real,
                       int imaginary)
      • Complex

        public Complex(double real)
      • Complex

        public Complex(long real)
      • Complex

        public Complex(long real,
                       long imaginary)
      • Complex

        public Complex(java.math.BigInteger real,
                       java.math.BigInteger imaginary)
      • Complex

        public Complex(java.math.BigInteger real)
    • Method Detail

      • get

        public Tensor get(int i)
        Description copied from class: Tensor
        Returns element at i-th position.
        Specified by:
        get in class Tensor
        Parameters:
        i - position
        Returns:
        element at i-th position
      • getIndices

        public Indices getIndices()
        Description copied from class: Tensor
        Returns indices of this tensor.
        Specified by:
        getIndices in class Tensor
        Returns:
        indices of this tensor
      • size

        public int size()
        Description copied from class: Tensor
        Returns the number of elements in this tensor.
        Specified by:
        size in class Tensor
        Returns:
        the number of elements in this tensor
      • toString

        public java.lang.String toString(OutputFormat mode)
        Description copied from class: Tensor
        Returns a string representation of a tensor according to the specified OutputFormat.
        Specified by:
        toString in class Tensor
        Parameters:
        mode - output format
        Returns:
        a string representation of a tensor
      • getImaginary

        public Real getImaginary()
      • getReal

        public Real getReal()
      • getImaginaryPart

        public Complex getImaginaryPart()
      • getRealPart

        public Complex getRealPart()
      • isReal

        public boolean isReal()
        Returns true if this number is real.
        Returns:
        true if this number is real
      • isImaginary

        public boolean isImaginary()
        Returns true if this number has only imaginary part.
        Returns:
        true if this number has only imaginary part
      • getImaginaryAsComplex

        public Complex getImaginaryAsComplex()
      • getRealAsComplex

        public Complex getRealAsComplex()
      • isOneOrMinusOne

        public boolean isOneOrMinusOne()
      • doubleValue

        public double doubleValue()
        Returns double value of the real part.
        Specified by:
        doubleValue in interface Number<Complex>
        Returns:
        double value of the real part
      • floatValue

        public float floatValue()
        Returns float value of the real part.
        Specified by:
        floatValue in interface Number<Complex>
        Returns:
        float value of the real part
      • intValue

        public int intValue()
        Returns int value of the real part.
        Specified by:
        intValue in interface Number<Complex>
        Returns:
        int value of the real part
      • longValue

        public long longValue()
        Returns long value of the real part.
        Specified by:
        longValue in interface Number<Complex>
        Returns:
        long value of the real part
      • conjugate

        public Complex conjugate()
        Return the conjugate of this complex number. The conjugate of a + bi is a - bi.
        ComplexNaN is returned if either the real or imaginary part of this Complex number equals Double.NaN.
        If the imaginary part is infinite, and the real part is not NaN, the returned value has infinite imaginary part of the opposite sign, e.g. the conjugate of 1 + POSITIVE_INFINITY i is 1 - NEGATIVE_INFINITY i.
        Returns:
        the conjugate of this Complex object.
      • add

        public Complex add(Complex a)
        Returns a Complex whose value is (this + addend). Uses the definitional formula
         
           (a + bi) + (c + di) = (a+c) + (b+d)i
         
         

        If either this or addend has a NaN value in either part, ComplexNaN is returned; otherwise Infinite and NaN values are returned in the parts of the result according to the rules for Double arithmetic.
        Specified by:
        add in interface org.apache.commons.math3.FieldElement<Complex>
        Parameters:
        a - value to be added to this Complex.
        Returns:
        this + addend.
        Throws:
        org.apache.commons.math3.exception.NullArgumentException - if addend is null.
      • divide

        public Complex divide(Complex divisor)
        Returns a Complex whose value is (this / divisor). Implements the definitional formula
         
            a + bi          ac + bd + (bc - ad)i
            ----------- = -------------------------
            c + di         c2 + d2
         
         
        but uses prescaling of operands to limit the effects of overflows and underflows in the computation.
        Infinite and NaN values are handled according to the following rules, applied in the order presented:
        • If either this or divisor has a NaN value in either part, ComplexNaN is returned.
        • If divisor equals ZERO, ComplexNaN is returned.
        • If this and divisor are both infinite, ComplexNaN is returned.
        • If this is finite (i.e., has no Infinite or NaN parts) and divisor is infinite (one or both parts infinite), ZERO is returned.
        • If this is infinite and divisor is finite, NaN values are returned in the parts of the result if the Double rules applied to the definitional formula force NaN results.
        Specified by:
        divide in interface org.apache.commons.math3.FieldElement<Complex>
        Parameters:
        divisor - Value by which this Complex is to be divided.
        Returns:
        this / divisor.
        Throws:
        org.apache.commons.math3.exception.NullArgumentException - if divisor is null.
      • getField

        public org.apache.commons.math3.Field<Complex> getField()
        Specified by:
        getField in interface org.apache.commons.math3.FieldElement<Complex>
      • multiply

        public Complex multiply(int n)
        Specified by:
        multiply in interface org.apache.commons.math3.FieldElement<Complex>
      • multiply

        public Complex multiply(Complex factor)
        Returns a Complex whose value is this * factor. Implements preliminary checks for NaN and infinity followed by the definitional formula:
         
           (a + bi)(c + di) = (ac - bd) + (ad + bc)i
         
         
        Returns ComplexNaN if either this or factor has one or more NaN parts.
        Returns COMPLEX_INFINITY if neither this nor factor has one or more NaN parts and if either this or factor has one or more infinite parts (same result is returned regardless of the sign of the components).
        Returns finite values in components of the result per the definitional formula in all remaining cases.
        Specified by:
        multiply in interface org.apache.commons.math3.FieldElement<Complex>
        Parameters:
        factor - value to be multiplied by this Complex.
        Returns:
        this * factor.
        Throws:
        org.apache.commons.math3.exception.NullArgumentException - if factor is null.
      • negate

        public Complex negate()
        Specified by:
        negate in interface org.apache.commons.math3.FieldElement<Complex>
      • reciprocal

        public Complex reciprocal()
        Specified by:
        reciprocal in interface org.apache.commons.math3.FieldElement<Complex>
      • subtract

        public Complex subtract(Complex a)
        Specified by:
        subtract in interface org.apache.commons.math3.FieldElement<Complex>
      • absNumeric

        public double absNumeric()
      • absNumeric

        public static double absNumeric(double real,
                                        double imaginary)
      • add

        public Complex add(org.apache.commons.math3.fraction.BigFraction fraction)
        Specified by:
        add in interface Number<Complex>
      • subtract

        public Complex subtract(org.apache.commons.math3.fraction.BigFraction fraction)
        Specified by:
        subtract in interface Number<Complex>
      • multiply

        public Complex multiply(org.apache.commons.math3.fraction.BigFraction fraction)
        Specified by:
        multiply in interface Number<Complex>
      • divide

        public Complex divide(org.apache.commons.math3.fraction.BigFraction fraction)
        Specified by:
        divide in interface Number<Complex>
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • logNumeric

        public Complex logNumeric()
        Returns natural logarithm of this
        Returns:
        natural logarithm of this
      • expNumeric

        public Complex expNumeric()
      • isNegativeNatural

        public boolean isNegativeNatural()
      • isPositiveNatural

        public boolean isPositiveNatural()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.