edu.jas.poly
Class ComplexRing<C extends RingElem<C>>
- java.lang.Object
-
- edu.jas.poly.ComplexRing<C>
-
- Type Parameters:
C- base type.
- All Implemented Interfaces:
- AbelianGroupFactory<Complex<C>>, ElemFactory<Complex<C>>, MonoidFactory<Complex<C>>, RingFactory<Complex<C>>, java.io.Serializable
public class ComplexRing<C extends RingElem<C>> extends java.lang.Object implements RingFactory<Complex<C>>
Generic Complex ring factory implementing the RingFactory interface. Objects of this class are immutable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description RingFactory<C>ringComplex class elements factory data structure.
-
Constructor Summary
Constructors Constructor and Description ComplexRing(RingFactory<C> ring)The constructor creates a ComplexRing object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AlgebraicNumberRing<C>algebraicRing()Corresponding algebraic number ring.java.math.BigIntegercharacteristic()Characteristic of this ring.Complex<C>copy(Complex<C> c)Copy Complex element c.booleanequals(java.lang.Object b)Comparison with any other object.Complex<C>fromInteger(java.math.BigInteger a)Get a Complex element from a BigInteger.Complex<C>fromInteger(long a)Get a Complex element from a long.java.util.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.inthashCode()Hash code for this ComplexRing<C>.booleanisAssociative()Query if this ring is associative.booleanisCommutative()Query if this ring is commutative.booleanisField()Query if this ring is a field.booleanisFinite()Is this structure finite or infinite.Complex<C>parse(java.io.Reader r)Parse complex number from Reader.Complex<C>parse(java.lang.String s)Parse complex number from string.Complex<C>random(int n)Complex number random.Complex<C>random(int n, java.util.Random rnd)Complex number random.java.lang.StringtoScript()Get a scripting compatible string representation.java.lang.StringtoString()Get the String representation.
-
-
-
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 java.util.List<Complex<C>> generators()
Get a list of the generating elements.- Specified by:
generatorsin interfaceElemFactory<Complex<C extends RingElem<C>>>- Returns:
- list of generators for the algebraic structure.
- See Also:
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:
isFinitein interfaceElemFactory<Complex<C extends RingElem<C>>>- Returns:
- true if this structure is finite, else false.
- See Also:
ElemFactory.isFinite()
-
isCommutative
public boolean isCommutative()
Query if this ring is commutative.- Specified by:
isCommutativein interfaceMonoidFactory<Complex<C extends RingElem<C>>>- Returns:
- true.
-
isAssociative
public boolean isAssociative()
Query if this ring is associative.- Specified by:
isAssociativein interfaceMonoidFactory<Complex<C extends RingElem<C>>>- Returns:
- true.
-
isField
public boolean isField()
Query if this ring is a field.
-
characteristic
public java.math.BigInteger characteristic()
Characteristic of this ring.- Specified by:
characteristicin interfaceRingFactory<Complex<C extends RingElem<C>>>- Returns:
- characteristic of this ring.
-
fromInteger
public Complex<C> fromInteger(java.math.BigInteger a)
Get a Complex element from a BigInteger.- Specified by:
fromIntegerin interfaceElemFactory<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:
fromIntegerin interfaceElemFactory<Complex<C extends RingElem<C>>>- Parameters:
a- long.- Returns:
- a Complex<C>.
-
toString
public java.lang.String toString()
Get the String representation.- Overrides:
toStringin classjava.lang.Object
-
toScript
public java.lang.String toScript()
Get a scripting compatible string representation.- Specified by:
toScriptin interfaceElemFactory<Complex<C extends RingElem<C>>>- Returns:
- script compatible representation for this Element.
- See Also:
Element.toScript()
-
equals
public boolean equals(java.lang.Object b)
Comparison with any other object.- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
hashCode
public int hashCode()
Hash code for this ComplexRing<C>.- Overrides:
hashCodein classjava.lang.Object- See Also:
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.
-
random
public Complex<C> random(int n, java.util.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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG