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