Package edu.jas.poly

Class ComplexRing<C extends RingElem<C>>

    • Field Detail

      • random

        private static final java.util.Random random
      • logger

        private static final org.apache.logging.log4j.Logger logger
      • 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

      • algebraicRing

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

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

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

        public java.math.BigInteger characteristic()
        Characteristic of this ring.
        Specified by:
        characteristic in interface RingFactory<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:
        fromInteger in interface ElemFactory<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<C extends RingElem<C>>
        Parameters:
        a - long.
        Returns:
        a Complex<C>.
      • toString

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

        public java.lang.String toScript()
        Get a scripting compatible string representation.
        Specified by:
        toScript in interface ElemFactory<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:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)
      • hashCode

        public int hashCode()
        Hash code for this ComplexRing<C>.
        Overrides:
        hashCode in class java.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.
        Specified by:
        random in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        n - such that 0 ≤ A, B ≤ (2n-1).
        Returns:
        R.
      • 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.
        Specified by:
        random in interface ElemFactory<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​(java.lang.String s)
        Parse complex number from string.
        Specified by:
        parse in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        s - String.
        Returns:
        Complex from s.
      • parse

        public Complex<C> parse​(java.io.Reader r)
        Parse complex number from Reader.
        Specified by:
        parse in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        r - Reader.
        Returns:
        next Complex from r.