org.ojalgo
Class ComplexNumber

java.lang.Object
  extended by java.lang.Number
      extended by org.ojalgo.ComplexNumber
All Implemented Interfaces:
Serializable, Comparable<ComplexNumber>

public final class ComplexNumber
extends Number
implements Comparable<ComplexNumber>

ComplexNumber is an immutable complex number class. It only implements the most basic complex number operations. ComplexFunction implements some of the more complicated ones.

Author:
apete
See Also:
ComplexMath, ComplexFunction, Serialized Form

Constructor Summary
ComplexNumber(double aRealValue)
           
 
Method Summary
 ComplexNumber add(ComplexNumber aNumber)
           
 ComplexNumber add(double aValue)
           
 int compareTo(ComplexNumber aNmbr)
           
 ComplexNumber conjugate()
           
 ComplexNumber divide(ComplexNumber aNumber)
           
 ComplexNumber divide(double aValue)
           
 double doubleValue()
           
 ComplexNumber enforce(NumberContext aCntxt)
           
 boolean equals(Object anObject)
           
 float floatValue()
           
static ComplexNumber fromPolarCoordinates(double aMod, double anArg)
           
static ComplexNumber fromRectangularCoordinates(double aRe, double anIm)
           
 double getArgument()
           
 double getImaginary()
           
 double getModulus()
           
 double getReal()
           
 int hashCode()
           
 int intValue()
           
 boolean isInfinite()
           
 boolean isNaN()
           
 boolean isZero()
           
 long longValue()
           
 ComplexNumber multiply(ComplexNumber aNumber)
           
 ComplexNumber multiply(double aValue)
           
 ComplexNumber negate()
           
 ComplexNumber subtract(ComplexNumber aNumber)
           
 ComplexNumber subtract(double aValue)
           
 String toString()
           
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComplexNumber

public ComplexNumber(double aRealValue)
Method Detail

fromPolarCoordinates

public static ComplexNumber fromPolarCoordinates(double aMod,
                                                 double anArg)

fromRectangularCoordinates

public static ComplexNumber fromRectangularCoordinates(double aRe,
                                                       double anIm)

add

public ComplexNumber add(ComplexNumber aNumber)

add

public ComplexNumber add(double aValue)

compareTo

public int compareTo(ComplexNumber aNmbr)
Specified by:
compareTo in interface Comparable<ComplexNumber>

conjugate

public ComplexNumber conjugate()

divide

public ComplexNumber divide(ComplexNumber aNumber)

divide

public ComplexNumber divide(double aValue)

doubleValue

public double doubleValue()
Specified by:
doubleValue in class Number
See Also:
Number.doubleValue()

enforce

public ComplexNumber enforce(NumberContext aCntxt)

equals

public boolean equals(Object anObject)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

floatValue

public float floatValue()
Specified by:
floatValue in class Number
See Also:
Number.floatValue()

getArgument

public double getArgument()

getImaginary

public double getImaginary()

getModulus

public double getModulus()

getReal

public double getReal()

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

intValue

public int intValue()
Specified by:
intValue in class Number
See Also:
Number.intValue()

isInfinite

public boolean isInfinite()

isNaN

public boolean isNaN()

isZero

public boolean isZero()

longValue

public long longValue()
Specified by:
longValue in class Number
See Also:
Number.longValue()

multiply

public ComplexNumber multiply(ComplexNumber aNumber)

multiply

public ComplexNumber multiply(double aValue)

negate

public ComplexNumber negate()

subtract

public ComplexNumber subtract(ComplexNumber aNumber)

subtract

public ComplexNumber subtract(double aValue)

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()