Class BigComplex

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(BigComplex other)
      Adds another BigComplex value to self.
      void add​(BigComplex a, BigComplex b)
      Set self to the result of addition between two BigComplex values.
      void complexConjugate()
      Does complex conjugation on self.
      BigComplex copy()
      Creates a new BigComplex whose values are taken from this BigComplex.
      BigComplex createVariable()
      Creates a new BigComplex initialized to (0,0).
      void div​(BigComplex other)
      Divides self by another BigComplex value.
      void div​(BigComplex a, BigComplex b)
      Set self to the result of division between two BigComplex values.
      void E()
      Fills self with the representation of e for the given type.
      BigDecimal getImag()
      Gets imaginary component of this complex number as a BigDecimal.
      double getImaginaryDouble()
      Gets imaginary component as a double (narrowing possible).
      float getImaginaryFloat()
      Gets imaginary component as a float (narrowing possible).
      BigDecimal getPhase()
      Gets phase as a BigDecimal.
      double getPhaseDouble()
      Gets phase as a double (narrowing possible).
      float getPhaseFloat()
      Gets phase as a float (narrowing possible).
      BigDecimal getPower()
      Gets magnitude as a BigDecimal.
      double getPowerDouble()
      Gets magnitude as a double (narrowing possible).
      float getPowerFloat()
      Gets magnitude as a float (narrowing possible).
      BigDecimal getReal()
      Gets real component of this complex number as a BigDecimal.
      double getRealDouble()
      Gets real component as a double (narrowing possible).
      float getRealFloat()
      Gets real component as a float (narrowing possible).
      void mul​(double c)
      Multiplies self by a scalar (double) constant.
      void mul​(float c)
      Multiplies self by a scalar (float) constant.
      void mul​(BigComplex other)
      Multiplies another BigComplex value with self.
      void mul​(BigComplex a, BigComplex b)
      Set self to the result of multiplication between two BigComplex values.
      void PI()
      Fills self with the representation of pi for the given type.
      void pow​(double power)  
      void pow​(BigComplex c)  
      void set​(double r, double i)
      Sets the real and imaginary components of this BigComplex to given double values.
      void set​(long r, long i)
      Sets the real and imaginary components of this BigComplex to given long values.
      void set​(String r, String i)
      Sets the real and imaginary components of this BigComplex to given String values.
      void set​(BigDecimal r, BigDecimal i)
      Sets the real and imaginary components of this BigComplex to given BigDecimal values.
      void set​(BigInteger r, BigInteger i)
      Sets the real and imaginary components of this BigComplex to given BigInteger values.
      void set​(BigComplex other)
      Sets the real and imaginary components of this BigComplex to match those of another.
      void setComplexNumber​(double r, double i)
      Sets the real and imaginary components of this BigComplex to given double values.
      void setComplexNumber​(float r, float i)
      Sets the real and imaginary components of this BigComplex to given float values.
      void setComplexNumber​(String r, String i)
      Sets the real and imaginary components of this BigComplex to given String values.
      void setComplexNumber​(BigDecimal r, BigDecimal i)
      Sets the real and imaginary components of this BigComplex to given BigDecimal values.
      void setImag​(double i)
      Sets the imaginary component of this BigComplex to given double value.
      void setImag​(long i)
      Sets the imaginary component of this BigComplex to given long value.
      void setImag​(String i)
      Sets the imaginary component of this BigComplex to given String value.
      void setImag​(BigDecimal i)
      Sets the imaginary component of this BigComplex to given BigDecimal value.
      void setImag​(BigInteger i)
      Sets the imaginary component of this BigComplex to given BigInteger value.
      void setImaginary​(double f)
      Sets the imaginary component of this BigComplex to given double value.
      void setImaginary​(float f)
      Sets the imaginary component of this BigComplex to given float value.
      void setOne()
      Sets this BigComplex to the unity value.
      void setReal​(double r)
      Sets the real component of this BigComplex to given double value.
      void setReal​(float f)
      Sets the real component of this BigComplex to given float value.
      void setReal​(long r)
      Sets the real component of this BigComplex to given long value.
      void setReal​(String r)
      Sets the real component of this BigComplex to given String value.
      void setReal​(BigDecimal r)
      Sets the real component of this BigComplex to given BigDecimal value.
      void setReal​(BigInteger r)
      Sets the real component of this BigComplex to given BigInteger value.
      void setZero()
      Sets this BigComplex to the zero value.
      void sub​(BigComplex other)
      Subtracts another BigComplex value from self.
      void sub​(BigComplex a, BigComplex b)
      Set self to the result of subtraction between two BigComplex values.
      boolean valueEquals​(BigComplex t)  
    • Constructor Detail

      • BigComplex

        public BigComplex()
        Default constructor: value = (0,0).
      • BigComplex

        public BigComplex​(long r,
                          long i)
        Constructor from longs.
      • BigComplex

        public BigComplex​(double r,
                          double i)
        Constructor from doubles.
      • BigComplex

        public BigComplex​(String r,
                          String i)
        Constructor from Strings. The strings must represent numbers that BigDecimal can parse.
    • Method Detail

      • getReal

        public BigDecimal getReal()
        Gets real component of this complex number as a BigDecimal.
      • getImag

        public BigDecimal getImag()
        Gets imaginary component of this complex number as a BigDecimal.
      • set

        public void set​(BigComplex other)
        Sets the real and imaginary components of this BigComplex to match those of another.
        Specified by:
        set in interface Type<BigComplex>
      • set

        public void set​(long r,
                        long i)
        Sets the real and imaginary components of this BigComplex to given long values.
      • set

        public void set​(double r,
                        double i)
        Sets the real and imaginary components of this BigComplex to given double values.
      • set

        public void set​(BigInteger r,
                        BigInteger i)
        Sets the real and imaginary components of this BigComplex to given BigInteger values.
      • set

        public void set​(BigDecimal r,
                        BigDecimal i)
        Sets the real and imaginary components of this BigComplex to given BigDecimal values.
      • set

        public void set​(String r,
                        String i)
        Sets the real and imaginary components of this BigComplex to given String values. The strings must represent numbers that BigDecimal can parse.
      • setReal

        public void setReal​(long r)
        Sets the real component of this BigComplex to given long value.
      • setReal

        public void setReal​(float f)
        Sets the real component of this BigComplex to given float value.
        Specified by:
        setReal in interface ComplexType<BigComplex>
      • setReal

        public void setReal​(double r)
        Sets the real component of this BigComplex to given double value.
        Specified by:
        setReal in interface ComplexType<BigComplex>
      • setReal

        public void setReal​(BigInteger r)
        Sets the real component of this BigComplex to given BigInteger value.
      • setReal

        public void setReal​(BigDecimal r)
        Sets the real component of this BigComplex to given BigDecimal value.
      • setReal

        public void setReal​(String r)
        Sets the real component of this BigComplex to given String value. The string must represent a number that BigDecimal can parse.
      • setImag

        public void setImag​(long i)
        Sets the imaginary component of this BigComplex to given long value.
      • setImag

        public void setImag​(double i)
        Sets the imaginary component of this BigComplex to given double value.
      • setImag

        public void setImag​(BigInteger i)
        Sets the imaginary component of this BigComplex to given BigInteger value.
      • setImag

        public void setImag​(BigDecimal i)
        Sets the imaginary component of this BigComplex to given BigDecimal value.
      • setImag

        public void setImag​(String i)
        Sets the imaginary component of this BigComplex to given String value. The string must represent a number that BigDecimal can parse.
      • setImaginary

        public void setImaginary​(float f)
        Sets the imaginary component of this BigComplex to given float value.
        Specified by:
        setImaginary in interface ComplexType<BigComplex>
      • setImaginary

        public void setImaginary​(double f)
        Sets the imaginary component of this BigComplex to given double value.
        Specified by:
        setImaginary in interface ComplexType<BigComplex>
      • setComplexNumber

        public void setComplexNumber​(float r,
                                     float i)
        Sets the real and imaginary components of this BigComplex to given float values.
        Specified by:
        setComplexNumber in interface ComplexType<BigComplex>
      • setComplexNumber

        public void setComplexNumber​(double r,
                                     double i)
        Sets the real and imaginary components of this BigComplex to given double values.
        Specified by:
        setComplexNumber in interface ComplexType<BigComplex>
      • setComplexNumber

        public void setComplexNumber​(BigDecimal r,
                                     BigDecimal i)
        Sets the real and imaginary components of this BigComplex to given BigDecimal values.
      • setComplexNumber

        public void setComplexNumber​(String r,
                                     String i)
        Sets the real and imaginary components of this BigComplex to given String values. The strings must represent numbers that BigDecimal can parse.
      • setZero

        public void setZero()
        Sets this BigComplex to the zero value.
        Specified by:
        setZero in interface SetZero
      • setOne

        public void setOne()
        Sets this BigComplex to the unity value.
        Specified by:
        setOne in interface SetOne
      • copy

        public BigComplex copy()
        Creates a new BigComplex whose values are taken from this BigComplex.
        Specified by:
        copy in interface Type<BigComplex>
      • add

        public void add​(BigComplex a,
                        BigComplex b)
        Set self to the result of addition between two BigComplex values.
      • add

        public void add​(BigComplex other)
        Adds another BigComplex value to self.
        Specified by:
        add in interface Add<BigComplex>
      • sub

        public void sub​(BigComplex a,
                        BigComplex b)
        Set self to the result of subtraction between two BigComplex values.
      • sub

        public void sub​(BigComplex other)
        Subtracts another BigComplex value from self.
        Specified by:
        sub in interface Sub<BigComplex>
      • mul

        public void mul​(BigComplex a,
                        BigComplex b)
        Set self to the result of multiplication between two BigComplex values.
      • mul

        public void mul​(BigComplex other)
        Multiplies another BigComplex value with self.
        Specified by:
        mul in interface Mul<BigComplex>
      • div

        public void div​(BigComplex a,
                        BigComplex b)
        Set self to the result of division between two BigComplex values. Precision loss is possible.
      • div

        public void div​(BigComplex other)
        Divides self by another BigComplex value. Precision loss is possible.
        Specified by:
        div in interface Div<BigComplex>
      • mul

        public void mul​(float c)
        Multiplies self by a scalar (float) constant.
        Specified by:
        mul in interface MulFloatingPoint
      • mul

        public void mul​(double c)
        Multiplies self by a scalar (double) constant.
        Specified by:
        mul in interface MulFloatingPoint
      • getPower

        public BigDecimal getPower()
        Gets magnitude as a BigDecimal.
      • getPhase

        public BigDecimal getPhase()
        Gets phase as a BigDecimal.
      • PI

        public void PI()
        Fills self with the representation of pi for the given type.
      • E

        public void E()
        Fills self with the representation of e for the given type.