Package edu.jas.poly

Class AlgebraicNumberRing<C extends RingElem<C>>

    • Constructor Detail

      • AlgebraicNumberRing

        public AlgebraicNumberRing​(GenPolynomial<C> m)
        The constructor creates a AlgebraicNumber factory object from a GenPolynomial objects module.
        Parameters:
        m - module GenPolynomial.
      • AlgebraicNumberRing

        public AlgebraicNumberRing​(GenPolynomial<C> m,
                                   boolean isField)
        The constructor creates a AlgebraicNumber factory object from a GenPolynomial objects module.
        Parameters:
        m - module GenPolynomial.
        isField - indicator if m is prime.
    • Method Detail

      • isField

        public boolean isField()
        Query if this ring is a field.
        Specified by:
        isField in interface RingFactory<C extends RingElem<C>>
        Returns:
        true if modul is prime, else false.
      • setField

        public void setField​(boolean field)
        Set field property of this ring.
        Parameters:
        field - true, if this ring is determined to be a field, false, if it is determined that it is not a field.
      • getField

        public int getField()
        Get the internal field indicator.
        Returns:
        internal field indicator.
      • fillFromInteger

        public AlgebraicNumber<CfillFromInteger​(java.math.BigInteger a)
        Get an AlgebraicNumber element from a BigInteger value. If a = a_k p^k + ... + a_0 p^0 then b = a_k x^k + ... + a_0 x^0, where p = characteristic( this ).
        Parameters:
        a - BigInteger.
        Returns:
        b an AlgebraicNumber.
      • fillFromInteger

        public AlgebraicNumber<CfillFromInteger​(long a)
        Get a AlgebraicNumber element from a long value.
        Parameters:
        a - long.
        Returns:
        a AlgebraicNumber.
      • toString

        public java.lang.String toString()
        Get the String representation as RingFactory.
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()
      • 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 AlgebraicNumber.
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • random

        public AlgebraicNumber<Crandom​(int n,
                                         java.util.Random rnd)
        AlgebraicNumber random.
        Specified by:
        random in interface ElemFactory<C extends RingElem<C>>
        Parameters:
        n - such that 0 ≤ v ≤ (2n-1).
        rnd - is a source for random bits.
        Returns:
        a random integer mod modul.
      • chineseRemainder

        public AlgebraicNumber<CchineseRemainder​(AlgebraicNumber<C> c,
                                                   AlgebraicNumber<C> ci,
                                                   AlgebraicNumber<C> a)
        AlgebraicNumber chinese remainder algorithm. Assert deg(c.modul) ≥ deg(a.modul) and c.modul * a.modul = this.modul.
        Parameters:
        c - AlgebraicNumber.
        ci - inverse of c.modul in ring of a.
        a - other AlgebraicNumber.
        Returns:
        S, with S mod c.modul == c and S mod a.modul == a.
      • interpolate

        public AlgebraicNumber<Cinterpolate​(AlgebraicNumber<C> c,
                                              C ci,
                                              C am,
                                              C a)
        AlgebraicNumber interpolation algorithm. Assert deg(c.modul) ≥ deg(A.modul) and c.modul * A.modul = this.modul. Special case with deg(A.modul) == 1. Similar algorithm as chinese remainder algorithm.
        Parameters:
        c - AlgebraicNumber.
        ci - inverse of (c.modul)(a) in ring of A.
        am - trailing base coefficient of modul of other AlgebraicNumber A.
        a - value of other AlgebraicNumber A.
        Returns:
        S, with S(c) == c and S(A) == a.
      • depth

        public int depth()
        Depth of extension field tower.
        Returns:
        number of nested algebraic extension fields
      • extensionDegree

        public long extensionDegree()
        Degree of extension field.
        Returns:
        degree of this algebraic extension field
      • totalExtensionDegree

        public long totalExtensionDegree()
        Total degree of nested extension fields.
        Returns:
        degree of tower of algebraic extension fields
      • iterator

        public java.util.Iterator<AlgebraicNumber<C>> iterator()
        Get a AlgebraicNumber iterator. Note: Only for finite field coefficients or fields which are iterable.
        Specified by:
        iterator in interface java.lang.Iterable<C extends RingElem<C>>
        Returns:
        a iterator over all algebraic numbers in this ring.