C
- base type of RingElem (for complex polynomials).public class Complex<C extends RingElem<C>> extends java.lang.Object implements StarRingElem<Complex<C>>, GcdRingElem<Complex<C>>
Modifier and Type | Field and Description |
---|---|
protected C |
im
Imaginary part of the data structure.
|
protected C |
re
Real part of the data structure.
|
ComplexRing<C> |
ring
Complex class factory data structure.
|
Constructor and Description |
---|
Complex(ComplexRing<C> ring)
The constructor creates a Complex object with real part 0 and imaginary
part 0.
|
Complex(ComplexRing<C> ring,
C r)
The constructor creates a Complex object from a C object as real part,
the imaginary part is set to 0.
|
Complex(ComplexRing<C> ring,
C r,
C i)
The constructor creates a Complex object from two C objects as real and
imaginary part.
|
Complex(ComplexRing<C> ring,
long r)
The constructor creates a Complex object from a long element as real
part, the imaginary part is set to 0.
|
Complex(ComplexRing<C> ring,
java.lang.String s)
The constructor creates a Complex object from a String representation.
|
Modifier and Type | Method and Description |
---|---|
Complex<C> |
abs()
Complex number absolute value.
|
int |
compareTo(Complex<C> b)
Since complex numbers are unordered, we use lexicographical order of re
and im.
|
Complex<C> |
conjugate()
Complex number conjugate.
|
Complex<C> |
copy()
Copy this.
|
Complex<C> |
divide(Complex<C> B)
Complex number divide.
|
Complex<C>[] |
egcd(Complex<C> S)
Complex extended greatest common divisor.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
ComplexRing<C> |
factory()
Get the corresponding element factory.
|
Complex<C> |
gcd(Complex<C> S)
Complex number greatest common divisor.
|
C |
getIm()
Get the imaginary part.
|
C |
getRe()
Get the real part.
|
int |
hashCode()
Hash code for this Complex.
|
Complex<C> |
inverse()
Complex number inverse.
|
boolean |
isIMAG()
Is Complex imaginary one.
|
boolean |
isONE()
Is Complex number one.
|
boolean |
isUnit()
Is Complex unit element.
|
boolean |
isZERO()
Is Complex number zero.
|
Complex<C> |
multiply(Complex<C> B)
Complex number product.
|
Complex<C> |
negate()
Complex number negative.
|
Complex<C> |
norm()
Complex number norm.
|
Complex<C>[] |
quotientRemainder(Complex<C> S)
Complex number quotient and remainder.
|
Complex<C> |
remainder(Complex<C> S)
Complex number remainder.
|
int |
signum()
Since complex numbers are unordered, we use lexicographical order of re
and im.
|
Complex<C> |
subtract(Complex<C> B)
Complex number subtract.
|
Complex<C> |
sum(Complex<C> B)
Complex number summation.
|
java.lang.String |
toScript()
Get a scripting compatible string representation.
|
java.lang.String |
toScriptFactory()
Get a scripting compatible string representation of the factory.
|
java.lang.String |
toString()
Get the String representation.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
leftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainder
public final ComplexRing<C extends RingElem<C>> ring
public Complex(ComplexRing<C> ring, C r, C i)
ring
- factory for Complex objects.r
- real part.i
- imaginary part.public Complex(ComplexRing<C> ring, C r)
r
- real part.public Complex(ComplexRing<C> ring, long r)
r
- real part.public Complex(ComplexRing<C> ring)
public Complex(ComplexRing<C> ring, java.lang.String s) throws java.lang.NumberFormatException
s
- string of a Complex.java.lang.NumberFormatException
public ComplexRing<C> factory()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toScript()
public java.lang.String toScriptFactory()
toScriptFactory
in interface Element<Complex<C extends RingElem<C>>>
Element.toScriptFactory()
public boolean isZERO()
isZERO
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
AbelianGroupElem.isZERO()
public boolean isONE()
isONE
in interface MonoidElem<Complex<C extends RingElem<C>>>
MonoidElem.isONE()
public boolean isIMAG()
public boolean isUnit()
isUnit
in interface MonoidElem<Complex<C extends RingElem<C>>>
MonoidElem.isUnit()
public boolean equals(java.lang.Object b)
public int hashCode()
public int compareTo(Complex<C> b)
public int signum()
signum
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
AbelianGroupElem.signum()
public Complex<C> negate()
negate
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
AbelianGroupElem.negate()
public Complex<C> norm()
norm
in interface StarRingElem<Complex<C extends RingElem<C>>>
StarRingElem.norm()
public Complex<C> abs()
abs
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
AbelianGroupElem.abs()
public Complex<C> inverse()
inverse
in interface MonoidElem<Complex<C extends RingElem<C>>>
MonoidElem.inverse()
public Complex<C>[] quotientRemainder(Complex<C> S)
quotientRemainder
in interface MonoidElem<Complex<C extends RingElem<C>>>
S
- Complex.