ComplexRing
edu.jas.poly

## Class ComplexRing<C extends RingElem<C>>

• ### Field Summary

Fields
Modifier and TypeField and Description
`RingFactory<C>``ring`
Complex class elements factory data structure.
• ### Constructor Summary

Constructors
Constructor and Description
`ComplexRing(RingFactory<C> ring)`
The constructor creates a ComplexRing object.
• ### Method Summary

Methods
Modifier and TypeMethod and Description
`AlgebraicNumberRing<C>``algebraicRing()`
Corresponding algebraic number ring.
`BigInteger``characteristic()`
Characteristic of this ring.
`Complex<C>``copy(Complex<C> c)`
Copy Complex element c.
`boolean``equals(Object b)`
Comparison with any other object.
`Complex<C>``fromInteger(BigInteger a)`
Get a Complex element from a BigInteger.
`Complex<C>``fromInteger(long a)`
Get a Complex element from a long.
`List<Complex<C>>``generators()`
Get a list of the generating elements.
`Complex<C>``getIMAG()`
Get the i element.
`Complex<C>``getONE()`
Get the one element.
`Complex<C>``getZERO()`
Get the zero element.
`int``hashCode()`
Hash code for this ComplexRing<C>.
`boolean``isAssociative()`
Query if this ring is associative.
`boolean``isCommutative()`
Query if this ring is commutative.
`boolean``isField()`
Query if this ring is a field.
`boolean``isFinite()`
Is this structure finite or infinite.
`Complex<C>``parse(Reader r)`
`Complex<C>``parse(String s)`
Parse complex number from string.
`Complex<C>``random(int n)`
Complex number random.
`Complex<C>``random(int n, Random rnd)`
Complex number random.
`String``toScript()`
Get a scripting compatible string representation.
`String``toString()`
Get the String representation.
• ### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`
• ### Field Detail

• #### ring

`public final RingFactory<C extends RingElem<C>> ring`
Complex class elements factory data structure.
• ### Constructor Detail

• #### ComplexRing

`public ComplexRing(RingFactory<C> ring)`
The constructor creates a ComplexRing object.
Parameters:
`ring` - factory for Complex real and imaginary parts.
• ### Method Detail

• #### generators

`public List<Complex<C>> generators()`
Get a list of the generating elements.
Specified by:
`generators` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Returns:
list of generators for the algebraic structure.
`ElemFactory.generators()`
• #### algebraicRing

`public AlgebraicNumberRing<C> algebraicRing()`
Corresponding algebraic number ring.
Returns:
algebraic number ring. not jet possible.
• #### isFinite

`public boolean isFinite()`
Is this structure finite or infinite.
Specified by:
`isFinite` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Returns:
true if this structure is finite, else false.
`ElemFactory.isFinite()`
• #### copy

`public Complex<C> copy(Complex<C> c)`
Copy Complex element c.
Specified by:
`copy` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`c` - Complex<C>.
Returns:
a copy of c.
• #### getZERO

`public Complex<C> getZERO()`
Get the zero element.
Specified by:
`getZERO` in interface `AbelianGroupFactory<Complex<C extends RingElem<C>>>`
Returns:
0 as Complex<C>.
• #### getONE

`public Complex<C> getONE()`
Get the one element.
Specified by:
`getONE` in interface `MonoidFactory<Complex<C extends RingElem<C>>>`
Returns:
1 as Complex<C>.
• #### getIMAG

`public Complex<C> getIMAG()`
Get the i element.
Returns:
i as Complex<C>.
• #### isCommutative

`public boolean isCommutative()`
Query if this ring is commutative.
Specified by:
`isCommutative` in interface `MonoidFactory<Complex<C extends RingElem<C>>>`
Returns:
true.
• #### isAssociative

`public boolean isAssociative()`
Query if this ring is associative.
Specified by:
`isAssociative` in interface `MonoidFactory<Complex<C extends RingElem<C>>>`
Returns:
true.
• #### isField

`public boolean isField()`
Query if this ring is a field.
Specified by:
`isField` in interface `RingFactory<Complex<C extends RingElem<C>>>`
Returns:
true.
• #### characteristic

`public BigInteger characteristic()`
Characteristic of this ring.
Specified by:
`characteristic` in interface `RingFactory<Complex<C extends RingElem<C>>>`
Returns:
characteristic of this ring.
• #### fromInteger

`public Complex<C> fromInteger(BigInteger a)`
Get a Complex element from a BigInteger.
Specified by:
`fromInteger` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`a` - BigInteger.
Returns:
a Complex<C>.
• #### fromInteger

`public Complex<C> fromInteger(long a)`
Get a Complex element from a long.
Specified by:
`fromInteger` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`a` - long.
Returns:
a Complex<C>.
• #### toString

`public String toString()`
Get the String representation.
Overrides:
`toString` in class `Object`
• #### toScript

`public String toScript()`
Get a scripting compatible string representation.
Specified by:
`toScript` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Returns:
script compatible representation for this Element.
`Element.toScript()`
• #### equals

`public boolean equals(Object b)`
Comparison with any other object.
Overrides:
`equals` in class `Object`
`Object.equals(java.lang.Object)`
• #### hashCode

`public int hashCode()`
Hash code for this ComplexRing<C>.
Overrides:
`hashCode` in class `Object`
`Object.hashCode()`
• #### random

`public Complex<C> random(int n)`
Complex number random. Random base numbers A and B are generated using random(n). Then R is the complex number with real part A and imaginary part B.
Specified by:
`random` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`n` - such that 0 ≤ A, B ≤ (2n-1).
Returns:
R.
• #### random

`public Complex<C> random(int n,                Random rnd)`
Complex number random. Random base numbers A and B are generated using random(n). Then R is the complex number with real part A and imaginary part B.
Specified by:
`random` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`n` - such that 0 ≤ A, B ≤ (2n-1).
`rnd` - is a source for random bits.
Returns:
R.
• #### parse

`public Complex<C> parse(String s)`
Parse complex number from string.
Specified by:
`parse` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`s` - String.
Returns:
Complex from s.
• #### parse

`public Complex<C> parse(Reader r)`
Specified by:
`parse` in interface `ElemFactory<Complex<C extends RingElem<C>>>`
Parameters:
`r` - Reader.
Returns:
next Complex from r.