Class Complex


  • public class Complex
    extends Object
    This class handles complex values.
    Belongs to CDK module:
    qm
    • Field Detail

      • real

        public double real
        The real part of this value
      • imag

        public double imag
        The imaginary part of this value
    • Constructor Detail

      • Complex

        public Complex​(double real,
                       double imag)
        Creates a complex number
        Parameters:
        real - the real part
        imag - the imaginary part
      • Complex

        public Complex​(Complex c)
        Creates a copy of a complex object
    • Method Detail

      • setRealPart

        public void setRealPart​(double real)
        Sets the real part of this complex value
      • getRealPart

        public double getRealPart()
        Gets the real part of this complex value
      • setImaginaryPart

        public void setImaginaryPart​(double imag)
        Sets the imaginary part of this value
      • getImaginaryPart

        public double getImaginaryPart()
        Gets the imaginary part of this value
      • add

        public void add​(Complex c)
        Add a complex value
      • sub

        public void sub​(Complex c)
        Subtracs a complex value
      • mul

        public void mul​(Complex c)
        Multiply this value with a complex value
      • div

        public void div​(Complex c)
        Div this value by a complex value
      • toString

        public String toString()
        Create a string of the content of this class
        Overrides:
        toString in class Object