|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.jas.poly.Complex<C>
C
- base type.public class Complex<C extends RingElem<C>>
Generic Complex class implementing the RingElem interface. Objects of this class are immutable.
Field Summary | |
---|---|
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
Complex<C> |
abs()
Complex number absolute value. |
Complex<C> |
clone()
Clone this. |
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> |
divide(Complex<C> B)
Complex number divide. |
Complex<C>[] |
divideAndRemainder(Complex<C> S)
Deprecated. use quotientRemainder() |
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. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final ComplexRing<C extends RingElem<C>> ring
protected final C extends RingElem<C> re
protected final C extends RingElem<C> im
Constructor Detail |
---|
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
Method Detail |
---|
public ComplexRing<C> factory()
factory
in interface Element<Complex<C extends RingElem<C>>>
Element.factory()
public C getRe()
public C getIm()
public Complex<C> clone()
clone
in class java.lang.Object
Object.clone()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toScript()
toScript
in interface Element<Complex<C extends RingElem<C>>>
Element.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)
equals
in interface Element<Complex<C extends RingElem<C>>>
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in interface Element<Complex<C extends RingElem<C>>>
hashCode
in class java.lang.Object
Object.hashCode()
public int compareTo(Complex<C> b)
compareTo
in interface Element<Complex<C extends RingElem<C>>>
compareTo
in interface java.lang.Comparable<Complex<C extends RingElem<C>>>
public int signum()
signum
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
AbelianGroupElem.signum()
public Complex<C> sum(Complex<C> B)
sum
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
B
- a Complexpublic Complex<C> subtract(Complex<C> B)
subtract
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
B
- a Complexpublic Complex<C> negate()
negate
in interface AbelianGroupElem<Complex<C extends RingElem<C>>>
AbelianGroupElem.negate()
public Complex<C> conjugate()
conjugate
in interface StarRingElem<Complex<C extends RingElem<C>>>
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> multiply(Complex<C> B)
multiply
in interface MonoidElem<Complex<C extends RingElem<C>>>
B
- is a complex number.
public Complex<C> inverse()
inverse
in interface MonoidElem<Complex<C extends RingElem<C>>>
MonoidElem.inverse()
public Complex<C> remainder(Complex<C> S)
remainder
in interface MonoidElem<Complex<C extends RingElem<C>>>
S
- is a complex number.
public Complex<C> divide(Complex<C> B)
divide
in interface MonoidElem<Complex<C extends RingElem<C>>>
B
- is a complex number, non-zero.
public Complex<C>[] quotientRemainder(Complex<C> S)
S
- Complex.
@Deprecated public Complex<C>[] divideAndRemainder(Complex<C> S)
S
- Complex.
public Complex<C> gcd(Complex<C> S)
gcd
in interface RingElem<Complex<C extends RingElem<C>>>
S
- Complexpublic Complex<C>[] egcd(Complex<C> S)
egcd
in interface RingElem<Complex<C extends RingElem<C>>>
S
- Complex
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |