public final class BigComplex extends java.lang.Object implements StarRingElem<BigComplex>, GcdRingElem<BigComplex>, RingFactory<BigComplex>
| Modifier and Type | Field and Description |
|---|---|
static BigComplex |
I
The constant i.
|
BigRational |
im
Imaginary part of the data structure.
|
static BigComplex |
ONE
The constant 1.
|
BigRational |
re
Real part of the data structure.
|
static BigComplex |
ZERO
The constant 0.
|
| Constructor and Description |
|---|
BigComplex()
The constructor creates a BigComplex object with real part 0 and
imaginary part 0.
|
BigComplex(BigRational r)
The constructor creates a BigComplex object from a BigRational object as
real part, the imaginary part is set to 0.
|
BigComplex(BigRational r,
BigRational i)
The constructor creates a BigComplex object from two BigRational objects
real and imaginary part.
|
BigComplex(long r)
The constructor creates a BigComplex object from a long element as real
part, the imaginary part is set to 0.
|
BigComplex(java.lang.String s)
The constructor creates a BigComplex object from a String representation.
|
| Modifier and Type | Method and Description |
|---|---|
BigComplex |
abs()
Complex number absolute value.
|
long |
bitLength()
Returns the number of bits in the representation of this BigComplex,
including a sign bit.
|
static BigRational |
CABS(BigComplex A)
Complex number absolute value.
|
static BigComplex |
CCON(BigComplex A)
Complex number conjugate.
|
static BigComplex |
CDIF(BigComplex A,
BigComplex B)
Complex number difference.
|
java.math.BigInteger |
characteristic()
Characteristic of this ring.
|
static BigComplex |
CINV(BigComplex A)
Complex number inverse.
|
static BigComplex |
CNEG(BigComplex A)
Complex number negative.
|
int |
compareTo(BigComplex b)
Since complex numbers are unordered, we use lexicographical order of re
and im.
|
BigComplex |
conjugate()
Complex number conjugate.
|
BigComplex |
copy()
Clone this.
|
BigComplex |
copy(BigComplex c)
Copy BigComplex element c.
|
static BigComplex |
CPROD(BigComplex A,
BigComplex B)
Complex number product.
|
static BigComplex |
CQ(BigComplex A,
BigComplex B)
Complex number quotient.
|
static BigComplex |
CRAND(int n)
Complex number, random.
|
static BigComplex |
CSUM(BigComplex A,
BigComplex B)
Complex number sum.
|
BigComplex |
divide(BigComplex B)
Complex number divide.
|
BigComplex[] |
egcd(BigComplex S)
BigComplex extended greatest common divisor.
|
boolean |
equals(java.lang.Object b)
Comparison with any other object.
|
BigComplex |
factory()
Get the corresponding element factory.
|
BigComplex |
fromInteger(java.math.BigInteger a)
Get a BigComplex element from a BigInteger.
|
BigComplex |
fromInteger(long a)
Get a BigComplex element from a long.
|
BigComplex |
gcd(BigComplex S)
Complex number greatest common divisor.
|
java.util.List<BigComplex> |
generators()
Get a list of the generating elements.
|
BigRational |
getIm()
Get the imaginary part.
|
BigComplex |
getIMAG()
Get the i element.
|
BigComplex |
getONE()
Get the one element.
|
BigRational |
getRe()
Get the real part.
|
BigComplex |
getZERO()
Get the zero element.
|
int |
hashCode()
Hash code for this BigComplex.
|
BigComplex |
inverse()
Complex number inverse.
|
boolean |
isAssociative()
Query if this ring is associative.
|
boolean |
isCommutative()
Query if this ring is commutative.
|
static boolean |
isCONE(BigComplex A)
Complex number one.
|
static boolean |
isCZERO(BigComplex A)
Complex number zero.
|
boolean |
isField()
Query if this ring is a field.
|
boolean |
isFinite()
Is this structure finite or infinite.
|
boolean |
isIMAG()
Is Complex imaginary one.
|
boolean |
isONE()
Is Complex number one.
|
boolean |
isUnit()
Is Complex unit element.
|
boolean |
isZERO()
Is Complex number zero.
|
BigComplex |
multiply(BigComplex B)
Complex number product.
|
BigComplex |
negate()
Complex number negative.
|
BigComplex |
norm()
Complex number norm.
|
BigComplex |
parse(java.io.Reader r)
Parse complex number from Reader.
|
BigComplex |
parse(java.lang.String s)
Parse complex number from string.
|
BigComplex[] |
quotientRemainder(BigComplex S)
Quotient and remainder by division of this by S.
|
BigComplex |
random(int n)
Complex number, random.
|
BigComplex |
random(int n,
java.util.Random rnd)
Complex number, random.
|
BigComplex |
remainder(BigComplex S)
Complex number inverse.
|
int |
signum()
Since complex numbers are unordered, we use lexicographical order of re
and im.
|
BigComplex |
subtract(BigComplex B)
Complex number subtract.
|
BigComplex |
sum(BigComplex 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, waitleftDivide, leftRemainder, power, rightDivide, rightRemainder, twosidedDivide, twosidedRemainderpublic final BigRational re
public final BigRational im
public static final BigComplex ZERO
public static final BigComplex ONE
public static final BigComplex I
public BigComplex(BigRational r, BigRational i)
r - real part.i - imaginary part.public BigComplex(BigRational r)
r - real part.public BigComplex(long r)
r - real part.public BigComplex()
public BigComplex(java.lang.String s) throws java.lang.NumberFormatException
s - string of a BigComplex.java.lang.NumberFormatExceptionpublic BigComplex factory()
factory in interface Element<BigComplex>Element.factory()public java.util.List<BigComplex> generators()
generators in interface ElemFactory<BigComplex>ElemFactory.generators()public boolean isFinite()
isFinite in interface ElemFactory<BigComplex>ElemFactory.isFinite()public BigComplex copy()
copy in interface Element<BigComplex>Object.clone()public BigComplex copy(BigComplex c)
copy in interface ElemFactory<BigComplex>c - BigComplex.public BigComplex getZERO()
getZERO in interface AbelianGroupFactory<BigComplex>public BigComplex getONE()
getONE in interface MonoidFactory<BigComplex>public BigComplex getIMAG()
public boolean isCommutative()
isCommutative in interface MonoidFactory<BigComplex>public boolean isAssociative()
isAssociative in interface MonoidFactory<BigComplex>public boolean isField()
isField in interface RingFactory<BigComplex>public java.math.BigInteger characteristic()
characteristic in interface RingFactory<BigComplex>public BigComplex fromInteger(java.math.BigInteger a)
fromInteger in interface ElemFactory<BigComplex>a - BigInteger.public BigComplex fromInteger(long a)
fromInteger in interface ElemFactory<BigComplex>a - long.public BigRational getRe()
public BigRational getIm()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toScript()
toScript in interface Element<BigComplex>toScript in interface ElemFactory<BigComplex>Element.toScript()public java.lang.String toScriptFactory()
toScriptFactory in interface Element<BigComplex>Element.toScriptFactory()public static boolean isCZERO(BigComplex A)
A - is a complex number.public boolean isZERO()
isZERO in interface AbelianGroupElem<BigComplex>AbelianGroupElem.isZERO()public static boolean isCONE(BigComplex A)
A - is a complex number.public boolean isONE()
isONE in interface MonoidElem<BigComplex>MonoidElem.isONE()public boolean isIMAG()
public boolean isUnit()
isUnit in interface MonoidElem<BigComplex>MonoidElem.isUnit()public boolean equals(java.lang.Object b)
equals in interface Element<BigComplex>equals in class java.lang.ObjectObject.equals(java.lang.Object)public int hashCode()
hashCode in interface Element<BigComplex>hashCode in class java.lang.ObjectObject.hashCode()public int compareTo(BigComplex b)
compareTo in interface Element<BigComplex>compareTo in interface java.lang.Comparable<BigComplex>public int signum()
signum in interface AbelianGroupElem<BigComplex>AbelianGroupElem.signum()public BigComplex sum(BigComplex B)
sum in interface AbelianGroupElem<BigComplex>B - a BigComplex number.public static BigComplex CSUM(BigComplex A, BigComplex B)
A - and B are complex numbers.public static BigComplex CDIF(BigComplex A, BigComplex B)
A - and B are complex numbers.public BigComplex subtract(BigComplex B)
subtract in interface AbelianGroupElem<BigComplex>B - a BigComplex number.public static BigComplex CNEG(BigComplex A)
A - is a complex number.public BigComplex negate()
negate in interface AbelianGroupElem<BigComplex>AbelianGroupElem.negate()public static BigComplex CCON(BigComplex A)
A - is a complex number.public BigComplex conjugate()
conjugate in interface StarRingElem<BigComplex>public BigComplex norm()
norm in interface StarRingElem<BigComplex>StarRingElem.norm()public BigComplex abs()
abs in interface AbelianGroupElem<BigComplex>AbelianGroupElem.abs()public static BigRational CABS(BigComplex A)
A - is a complex number.public static BigComplex CPROD(BigComplex A, BigComplex B)
A - and B are complex numbers.public BigComplex multiply(BigComplex B)
multiply in interface MonoidElem<BigComplex>B - is a complex number.public static BigComplex CINV(BigComplex A)
A - is a non-zero complex number.public BigComplex inverse()
inverse in interface MonoidElem<BigComplex>MonoidElem.inverse()public BigComplex remainder(BigComplex S)
remainder in interface MonoidElem<BigComplex>S - is a complex number.public static BigComplex CQ(BigComplex A, BigComplex B)
A - and B are complex numbers, B non-zero.public BigComplex divide(BigComplex B)
divide in interface MonoidElem<BigComplex>B - is a complex number, non-zero.public BigComplex[] quotientRemainder(BigComplex S)
quotientRemainder in interface MonoidElem<BigComplex>S - a complex numberpublic BigComplex random(int n)
random in interface ElemFactory<BigComplex>n - such that 0 ≤ A, B ≤ (2n-1).public BigComplex random(int n, java.util.Random rnd)
random in interface ElemFactory<BigComplex>n - such that 0 ≤ A, B ≤ (2n-1).rnd - is a source for random bits.public static BigComplex CRAND(int n)
n - such that 0 ≤ A, B ≤ (2n-1).public BigComplex parse(java.lang.String s)
parse in interface ElemFactory<BigComplex>s - String.public BigComplex parse(java.io.Reader r)
parse in interface ElemFactory<BigComplex>r - Reader.public BigComplex gcd(BigComplex S)
gcd in interface RingElem<BigComplex>S - BigComplex.public BigComplex[] egcd(BigComplex S)
egcd in interface RingElem<BigComplex>S - BigComplex.public long bitLength()
re.bitLength() + im.bitLength().)