Package edu.jas.root

Class RealAlgebraicRing<C extends GcdRingElem<C> & Rational>

    • Constructor Detail

      • RealAlgebraicRing

        public RealAlgebraicRing​(GenPolynomial<C> m,
                                 Interval<C> root)
        The constructor creates a RealAlgebraicNumber factory object from a GenPolynomial objects module.
        Parameters:
        m - module GenPolynomial.
        root - isolating interval for a real root.
      • RealAlgebraicRing

        public RealAlgebraicRing​(GenPolynomial<C> m,
                                 Interval<C> root,
                                 boolean isField)
        The constructor creates a RealAlgebraicNumber factory object from a GenPolynomial objects module.
        Parameters:
        m - module GenPolynomial.
        root - isolating interval for a real root.
        isField - indicator if m is prime.
    • Method Detail

      • getRoot

        public Interval<C> getRoot()
        Get the interval for the real root. Note: interval may shrink later.
        Returns:
        real root isolating interval
      • setRoot

        public void setRoot​(Interval<C> v)
        Set a refined interval for the real root. Note: interval may shrink eventually.
        Parameters:
        v - interval.
      • getEps

        public BigRational getEps()
        Get the epsilon.
        Returns:
        eps.
      • setEps

        public void setEps​(C e)
        Set a new epsilon.
        Parameters:
        e - epsilon.
      • setEps

        public void setEps​(BigRational e)
        Set a new epsilon.
        Parameters:
        e - epsilon.
      • refineRoot

        public void refineRoot()
        Refine root.
      • refineRoot

        public void refineRoot​(BigRational e)
        Refine root.
        Parameters:
        e - epsilon.
      • halfInterval

        public void halfInterval()
        RealAlgebraicRing half interval.
      • copy

        public RealAlgebraicRing<C> copy()
        Copy this RealAlgebraicRing.
        Returns:
        a copy of this.
      • getGenerator

        public RealAlgebraicNumber<C> getGenerator()
        Get the generating element.
        Returns:
        alpha as RealAlgebraicNumber.
      • isField

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

        public void setField​(boolean isField)
        Assert that this ring is a field.
        Parameters:
        isField - true if this ring is a field, else false.
      • fromRational

        public RealAlgebraicNumber<C> fromRational​(BigRational a)
        Get a RealAlgebraicNumber element from a BigRational value.
        Parameters:
        a - BigRational.
        Returns:
        a RealAlgebraicNumber.
      • 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 RealAlgebraicNumber.
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()
      • random

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