org.ojalgo
Class ComplexNumber
java.lang.Object
java.lang.Number
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
ComplexNumber
public ComplexNumber(double aRealValue)
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()