public class ComplexNumber extends Number implements Scalar<ComplexNumber>, NumberContext.Enforceable<ComplexNumber>, Access2D<Double>, Transformation2D<Double>, Access2D.Collectable<Double,Mutate2D.Receiver<Double>>
ComplexFunction,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
ComplexNumber.Normalised |
Scalar.Factory<N extends Number>ScalarOperation.Addition<T,N extends Number>, ScalarOperation.Division<T,N extends Number>, ScalarOperation.Multiplication<T,N extends Number>, ScalarOperation.Subtraction<T,N extends Number>Access2D.Aggregatable<N extends Number>, Access2D.Collectable<N extends Number,R extends Mutate2D.Receiver<N>>, Access2D.Elements, Access2D.ElementView<N extends Number>, Access2D.IndexOf, Access2D.Sliceable<N extends Number>, Access2D.Visitable<N extends Number>Structure2D.IntRowColumn, Structure2D.Logical<S extends Structure2D,B extends Structure2D.Logical<S,?>>, Structure2D.LongRowColumn, Structure2D.ReducibleTo1D<R extends Structure1D>, Structure2D.RowColumnCallback, Structure2D.RowColumnKey<R,C>, Structure2D.RowColumnMapper<R,C>Structure1D.BasicMapper<T>, Structure1D.IndexCallback, Structure1D.IndexMapper<T>, Structure1D.IntIndex, Structure1D.LongIndex, Structure1D.LoopCallback| Modifier and Type | Field and Description |
|---|---|
static Scalar.Factory<ComplexNumber> |
FACTORY |
double |
i |
static ComplexNumber |
I
Complex number
i, satisfies i2 = -1; |
static ComplexNumber |
INFINITY
Complex number Z = (+∞ + 0.0i)
|
static ComplexNumber |
NaN
Complex number Z = (NaN + NaNi)
|
static ComplexNumber |
NEG
Complex number Z = (-1.0 + 0.0i)
|
static ComplexNumber |
ONE
Complex number Z = (1.0 + 0.0i)
|
static ComplexNumber |
TWO
Complex number Z = (2.0 + 0.0i)
|
static ComplexNumber |
ZERO
Complex number Z = (0.0 + 0.0i)
|
| Constructor and Description |
|---|
ComplexNumber()
Complex number constructor, returns
ZERO |
| Modifier and Type | Method and Description |
|---|---|
ComplexNumber |
add(ComplexNumber arg)
Performs the binary operation '+' with a complex number.
|
ComplexNumber |
add(double arg)
Performs the binary operation '+' with a real number
|
int |
compareTo(ComplexNumber reference)
Compares the specified
reference and this. |
ComplexNumber |
conjugate()
Returns the conjugate of this complex number.
|
long |
count()
count() == countRows() * countColumns()
|
long |
countColumns() |
long |
countRows() |
ComplexNumber |
divide(ComplexNumber arg)
Performs the binary operation '/' with a complex number.
|
ComplexNumber |
divide(double arg)
Performs the binary operation '/' with a real number.
|
double |
doubleValue() |
double |
doubleValue(long index) |
double |
doubleValue(long row,
long col)
Extracts one element of this matrix as a double.
|
ComplexNumber |
enforce(NumberContext context)
Will call NumberContext.enforce(double) on the real and imaginary parts separately.
|
boolean |
equals(Object obj) |
float |
floatValue() |
ComplexNumber |
get() |
Double |
get(long index) |
Double |
get(long row,
long col) |
double |
getArgument() |
double |
getImaginary() |
double |
getModulus() |
double |
getReal() |
int |
hashCode() |
int |
intValue() |
ComplexNumber |
invert()
Performs the unary operation '1/x'
|
boolean |
isAbsolute() |
static boolean |
isAbsolute(ComplexNumber value) |
static boolean |
isInfinite(ComplexNumber value)
Test if
value is infinite. |
static boolean |
isNaN(ComplexNumber value)
Test if
value is NaN. |
boolean |
isReal() |
static boolean |
isReal(ComplexNumber value)
Test if
value is real. |
boolean |
isSmall(double comparedTo) |
static boolean |
isSmall(double comparedTo,
ComplexNumber value) |
long |
longValue() |
static ComplexNumber |
makePolar(double norm,
double phase)
Static factory method returning a complex number from polar coordinates
|
static ComplexNumber.Normalised |
makeRotation(double angle) |
ComplexNumber |
multiply(ComplexNumber arg)
Performs the binary operation '*' with a complex number.
|
ComplexNumber |
multiply(double arg)
Performs the binary operation '*' with a real number.
|
ComplexNumber |
negate()
Performs the unary operation '-'.
|
double |
norm()
Returns the norm of this complex number.
|
static ComplexNumber |
of(double real,
double imaginary)
Static factory method returning a complex number from cartesian coordinates.
|
double |
phase()
Returns the phase of this complex number.
|
ComplexNumber.Normalised |
signum()
this == this.signum().multiply(this.norm()) |
ComplexNumber |
subtract(ComplexNumber arg)
Performs the binary operation '-' with a complex number.
|
ComplexNumber |
subtract(double arg)
Performs the binary operation '-' with a real number.
|
void |
supplyTo(Mutate2D.Receiver<Double> receiver) |
BigDecimal |
toBigDecimal() |
MatrixStore<Double> |
toMultiplicationMatrix() |
MatrixStore<Double> |
toMultiplicationVector() |
MatrixStore<Double> |
toRotationMatrix() |
String |
toString() |
String |
toString(NumberContext context) |
<T extends Mutate2D.ModifiableReceiver<Double> & Access2D<Double>> |
transform(T transformable) |
static ComplexNumber |
valueOf(double value)
Static factory method returning a complex number from a real value
|
static ComplexNumber |
valueOf(Number number)
Static factory method returning a complex number from arbitrary number
|
byteValue, shortValueclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, divide, multiply, subtract, toPlainStringbyteValue, shortValueasCollectable2D, asPrimitive2D, byteValue, byteValue, columns, elements, equals, floatValue, floatValue, intValue, intValue, longValue, longValue, newPrimitiveColumnCollectable, newPrimitiveRowCollectable, rows, shortValue, shortValue, toRawCopy2D, toString, wrap, wrapasCollectable1D, asPrimitive1D, axpy, dot, equals, hashCode, nonzeros, supplyTo, toRawCopy1D, toString, wrap, wrap, wrapcollectcolumn, column, column, column, column, count, index, index, isEmpty, isFat, isScalar, isSquare, isTall, isVector, loopAll, loopColumn, loopColumn, loopDiagonal, loopMatching, loopRow, loopRow, mapperOf, row, row, row, row, rowindex, loopAll, loopMatching, loopRange, mapper, sizepublic static final Scalar.Factory<ComplexNumber> FACTORY
public static final ComplexNumber I
i, satisfies i2 = -1;public static final ComplexNumber INFINITY
public static final ComplexNumber NaN
public static final ComplexNumber NEG
public static final ComplexNumber ONE
public static final ComplexNumber TWO
public static final ComplexNumber ZERO
public final double i
public ComplexNumber()
ZEROpublic static boolean isAbsolute(ComplexNumber value)
public static boolean isInfinite(ComplexNumber value)
value is infinite. A complex number is infinite if its real part and/or its imaginary
part is infinite.value - the complex number to testpublic static boolean isNaN(ComplexNumber value)
value is NaN. A complex number is NaN if its real and/or its imaginary part is NaN.value - the complex number to testpublic static boolean isReal(ComplexNumber value)
value is real. A complex number Z is real if and only if Im(Z) = 0.0.value - the complex number to testpublic static boolean isSmall(double comparedTo,
ComplexNumber value)
public static ComplexNumber makePolar(double norm, double phase)
norm - the complex number's normphase - the complex number's phasepublic static ComplexNumber.Normalised makeRotation(double angle)
public static ComplexNumber of(double real, double imaginary)
real - the complex number's real partimaginary - the complex number's imaginary partpublic static ComplexNumber valueOf(double value)
value - the complex number's real partvalue + 0.0i)public static ComplexNumber valueOf(Number number)
number - a numeric valueZERO if number is null otherwise the double value of
numberNumber,
Number.doubleValue()public ComplexNumber add(ComplexNumber arg)
add in interface ScalarOperation.Addition<Scalar<ComplexNumber>,ComplexNumber>arg - the complex number to addpublic ComplexNumber add(double arg)
add in interface ScalarOperation.Addition<Scalar<ComplexNumber>,ComplexNumber>arg - the real number to addpublic int compareTo(ComplexNumber reference)
reference and this. The numerical comparison uses following order :
|Z| -> Re(Z) -> Im(Z).compareTo in interface Comparable<ComplexNumber>reference - the complex number to compare withreference is numerically greater than this, 0 if this and
reference are numerically equal or a positive value if reference is numerically
lesser than this.public ComplexNumber conjugate()
conjugate in interface VectorSpace<Scalar<ComplexNumber>,ComplexNumber>public long count()
Structure2Dcount in interface Structure1Dcount in interface Structure2Dpublic long countColumns()
countColumns in interface Structure2Dpublic long countRows()
countRows in interface Structure2Dpublic ComplexNumber divide(ComplexNumber arg)
divide in interface ScalarOperation.Division<Scalar<ComplexNumber>,ComplexNumber>arg - the complex number to divide bypublic ComplexNumber divide(double arg)
divide in interface ScalarOperation.Division<Scalar<ComplexNumber>,ComplexNumber>arg - the real number to divide bypublic double doubleValue()
doubleValue in interface AccessScalar<ComplexNumber>doubleValue in class NumberNumber.doubleValue()public double doubleValue(long index)
doubleValue in interface Access1D<Double>doubleValue in interface Access2D<Double>public double doubleValue(long row,
long col)
Access2DdoubleValue in interface Access2D<Double>row - A row index.col - A column index.public ComplexNumber enforce(NumberContext context)
enforce in interface NumberContext.Enforceable<ComplexNumber>public float floatValue()
floatValue in interface AccessScalar<ComplexNumber>floatValue in class NumberNumber.floatValue()public ComplexNumber get()
get in interface AccessScalar<ComplexNumber>public Double get(long index)
public double getArgument()
public double getImaginary()
public double getModulus()
public double getReal()
public int intValue()
intValue in interface AccessScalar<ComplexNumber>intValue in class NumberNumber.intValue()public ComplexNumber invert()
invert in interface Group.Multiplicative<Scalar<ComplexNumber>>public boolean isAbsolute()
isAbsolute in interface Scalar<ComplexNumber>Scalar.isAbsolute()public boolean isReal()
public boolean isSmall(double comparedTo)
isSmall in interface NormedVectorSpace<Scalar<ComplexNumber>,ComplexNumber>comparedTo - What to compare withpublic long longValue()
longValue in interface AccessScalar<ComplexNumber>longValue in class NumberNumber.longValue()public ComplexNumber multiply(ComplexNumber arg)
multiply in interface ScalarOperation.Multiplication<Scalar<ComplexNumber>,ComplexNumber>arg - the complex number to multiply bypublic ComplexNumber multiply(double arg)
multiply in interface ScalarOperation.Multiplication<Scalar<ComplexNumber>,ComplexNumber>arg - the real number to multiply bypublic ComplexNumber negate()
negate in interface Group.Additive<Scalar<ComplexNumber>>public double norm()
norm in interface NormedVectorSpace<Scalar<ComplexNumber>,ComplexNumber>public double phase()
public ComplexNumber.Normalised signum()
NormedVectorSpacethis == this.signum().multiply(this.norm())signum in interface NormedVectorSpace<Scalar<ComplexNumber>,ComplexNumber>public ComplexNumber subtract(ComplexNumber arg)
subtract in interface ScalarOperation.Subtraction<Scalar<ComplexNumber>,ComplexNumber>arg - the complex number to subtractargpublic ComplexNumber subtract(double arg)
subtract in interface ScalarOperation.Subtraction<Scalar<ComplexNumber>,ComplexNumber>arg - the real number to subtractpublic void supplyTo(Mutate2D.Receiver<Double> receiver)
supplyTo in interface Access2D.Collectable<Double,Mutate2D.Receiver<Double>>public BigDecimal toBigDecimal()
toBigDecimal in interface Scalar<ComplexNumber>public MatrixStore<Double> toMultiplicationMatrix()
public MatrixStore<Double> toMultiplicationVector()
public MatrixStore<Double> toRotationMatrix()
public String toString()
toString in class ObjectObject.toString()public String toString(NumberContext context)
toString in interface Scalar<ComplexNumber>public <T extends Mutate2D.ModifiableReceiver<Double> & Access2D<Double>> void transform(T transformable)
transform in interface Transformation2D<Double>Copyright © 2019 Optimatika. All rights reserved.