edu.jas.root
Class ComplexRootsAbstract<C extends RingElem<C> & Rational>

java.lang.Object
  extended by edu.jas.root.ComplexRootsAbstract<C>
Type Parameters:
C - coefficient type.
All Implemented Interfaces:
ComplexRoots<C>
Direct Known Subclasses:
ComplexRootsSturm

public abstract class ComplexRootsAbstract<C extends RingElem<C> & Rational>
extends java.lang.Object
implements ComplexRoots<C>

Complex roots abstract class.

Author:
Heinz Kredel

Field Summary
 Squarefree<Complex<C>> engine
          Engine for square free decomposition.
 
Constructor Summary
ComplexRootsAbstract(RingFactory<Complex<C>> cf)
          Constructor.
 
Method Summary
 Complex<BigDecimal> approximateRoot(Rectangle<C> rt, GenPolynomial<Complex<C>> f, C eps)
          Approximate complex root.
 java.util.List<Complex<BigDecimal>> approximateRoots(GenPolynomial<Complex<C>> a, C eps)
          List of decimal approximations of complex roots of complex polynomial.
 Complex<C> complexMagnitude(Rectangle<C> rect, GenPolynomial<Complex<C>> f, GenPolynomial<Complex<C>> g, C eps)
          Complex algebraic number magnitude.
 Complex<C> complexRectangleMagnitude(Rectangle<C> rect, GenPolynomial<Complex<C>> f, GenPolynomial<Complex<C>> g)
          Complex algebraic number magnitude.
abstract  long complexRootCount(Rectangle<C> rect, GenPolynomial<Complex<C>> a)
          Complex root count of complex polynomial on rectangle.
 Rectangle<C> complexRootRefinement(Rectangle<C> rect, GenPolynomial<Complex<C>> a, BigRational len)
          Complex root refinement of complex polynomial a on rectangle.
 java.util.List<Rectangle<C>> complexRoots(GenPolynomial<Complex<C>> a)
          List of complex roots of complex polynomial.
 java.util.List<Rectangle<C>> complexRoots(GenPolynomial<Complex<C>> a, BigRational len)
          List of complex roots of complex polynomial.
abstract  java.util.List<Rectangle<C>> complexRoots(Rectangle<C> rect, GenPolynomial<Complex<C>> a)
          List of complex roots of complex polynomial a on rectangle.
 Complex[] copyOfComplex(Complex[] original, int newLength)
          Copy the specified array.
 Rectangle<C> invariantMagnitudeRectangle(Rectangle<C> rect, GenPolynomial<Complex<C>> f, GenPolynomial<Complex<C>> g, C eps)
          Invariant rectangle for algebraic number magnitude.
abstract  Rectangle<C> invariantRectangle(Rectangle<C> rect, GenPolynomial<Complex<C>> f, GenPolynomial<Complex<C>> g)
          Invariant rectangle for algebraic number.
 C magnitudeBound(Rectangle<C> rect, GenPolynomial<Complex<C>> f)
          Magnitude bound.
 Complex<C> rootBound(GenPolynomial<Complex<C>> f)
          Root bound.
 java.lang.String toDecimal(Complex<C> a)
          Get decimal approximation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

public final Squarefree<Complex<C extends RingElem<C> & Rational>> engine
Engine for square free decomposition.

Constructor Detail

ComplexRootsAbstract

public ComplexRootsAbstract(RingFactory<Complex<C>> cf)
Constructor.

Parameters:
cf - coefficient factory.
Method Detail

rootBound

public Complex<C> rootBound(GenPolynomial<Complex<C>> f)
Root bound. With f(-M + i M) * f(-M - i M) * f(M - i M) * f(M + i M) != 0.

Specified by:
rootBound in interface ComplexRoots<C extends RingElem<C> & Rational>
Parameters:
f - univariate polynomial.
Returns:
M such that root(f) is contained in the rectangle spanned by M.

magnitudeBound

public C magnitudeBound(Rectangle<C> rect,
                        GenPolynomial<Complex<C>> f)
Magnitude bound.

Parameters:
rect - rectangle.
f - univariate polynomial.
Returns:
B such that |f(c)| < B for c in rect.

complexRootCount

public abstract long complexRootCount(Rectangle<C> rect,
                                      GenPolynomial<Complex<C>> a)
                               throws InvalidBoundaryException
Complex root count of complex polynomial on rectangle.

Specified by:
complexRootCount in interface ComplexRoots<C extends RingElem<C> & Rational>
Parameters:
rect - rectangle.
a - univariate complex polynomial.
Returns:
root count of a in rectangle.
Throws:
InvalidBoundaryException

complexRoots

public abstract java.util.List<Rectangle<C>> complexRoots(Rectangle<C> rect,
                                                          GenPolynomial<Complex<C>> a)
                                                                                 throws InvalidBoundaryException
List of complex roots of complex polynomial a on rectangle.

Specified by:
complexRoots in interface ComplexRoots<C extends RingElem<C> & Rational>
Parameters:
rect - rectangle.
a - univariate squarefree complex polynomial.
Returns:
list of complex roots.
Throws:
InvalidBoundaryException

complexRoots

public java.util.List<Rectangle<C>> complexRoots(GenPolynomial<Complex<C>> a)
List of complex roots of complex polynomial.

Specified by:
complexRoots in interface ComplexRoots<C extends RingElem<C> & Rational>
Parameters:
a - univariate complex polynomial.
Returns:
list of complex roots.

complexRootRefinement

public Rectangle<C> complexRootRefinement(Rectangle<C> rect,
                                          GenPolynomial<Complex<C>> a,
                                          BigRational len)
                                                                 throws InvalidBoundaryException
Complex root refinement of complex polynomial a on rectangle.

Specified by:
complexRootRefinement in interface ComplexRoots<C extends RingElem<C> & Rational>
Parameters:
rect - rectangle containing exactly one complex root.
a - univariate squarefree complex polynomial.
len - rational length for refinement.
Returns:
refined complex root.
Throws:
InvalidBoundaryException

complexRoots

public java.util.List<Rectangle<C>> complexRoots(GenPolynomial<Complex<C>> a,
                                                 BigRational len)
List of complex roots of complex polynomial.

Parameters:
a - univariate complex polynomial.
len - rational length for refinement.
Returns:
list of complex roots to desired precision.

invariantRectangle

public abstract Rectangle<C> invariantRectangle(Rectangle<C> rect,
                                                GenPolynomial<Complex<C>> f,
                                                GenPolynomial<Complex<C>> g)
                                                                       throws InvalidBoundaryException
Invariant rectangle for algebraic number.

Parameters:
rect - root isolating rectangle for f which contains exactly one root.
f - univariate polynomial, non-zero.
g - univariate polynomial, gcd(f,g) == 1.
Returns:
v with v a new rectangle contained in iv such that g(w) != 0 for w in v.
Throws:
InvalidBoundaryException

toDecimal

public java.lang.String toDecimal(Complex<C> a)
Get decimal approximation.

Parameters:
a - complex number.
Returns:
decimal(a).

approximateRoot

public Complex<BigDecimal> approximateRoot(Rectangle<C> rt,
                                           GenPolynomial<Complex<C>> f,
                                           C eps)
                                    throws NoConvergenceException
Approximate complex root.

Parameters:
rt - root isolating rectangle.
f - univariate polynomial, non-zero.
eps - requested interval length.
Returns:
a decimal approximation d such that |d-v| < eps, for f(v) = 0, v in rt.
Throws:
NoConvergenceException

approximateRoots

public java.util.List<Complex<BigDecimal>> approximateRoots(GenPolynomial<Complex<C>> a,
                                                            C eps)
List of decimal approximations of complex roots of complex polynomial.

Parameters:
a - univariate complex polynomial.
eps - length for refinement.
Returns:
list of complex decimal root approximations to desired precision.

copyOfComplex

public Complex[] copyOfComplex(Complex[] original,
                               int newLength)
Copy the specified array.

Parameters:
original - array.
newLength - new array length.
Returns:
copy of this.

invariantMagnitudeRectangle

public Rectangle<C> invariantMagnitudeRectangle(Rectangle<C> rect,
                                                GenPolynomial<Complex<C>> f,
                                                GenPolynomial<Complex<C>> g,
                                                C eps)
                                                                       throws InvalidBoundaryException
Invariant rectangle for algebraic number magnitude.

Parameters:
rect - root isolating rectangle for f which contains exactly one root.
f - univariate polynomial, non-zero.
g - univariate polynomial, gcd(f,g) == 1.
eps - length limit for rectangle length.
Returns:
v with v a new rectangle contained in rect such that |g(a) - g(b)| < eps for a, b in v in rect.
Throws:
InvalidBoundaryException

complexRectangleMagnitude

public Complex<C> complexRectangleMagnitude(Rectangle<C> rect,
                                            GenPolynomial<Complex<C>> f,
                                            GenPolynomial<Complex<C>> g)
Complex algebraic number magnitude.

Parameters:
rect - root isolating rectangle for f which contains exactly one root, with rect such that |g(a) - g(b)| < eps for a, b in rect.
f - univariate polynomial, non-zero.
g - univariate polynomial, gcd(f,g) == 1.
Returns:
g(rect) .

complexMagnitude

public Complex<C> complexMagnitude(Rectangle<C> rect,
                                   GenPolynomial<Complex<C>> f,
                                   GenPolynomial<Complex<C>> g,
                                   C eps)
                                                          throws InvalidBoundaryException
Complex algebraic number magnitude.

Parameters:
rect - root isolating rectangle for f which contains exactly one root, with rect such that |g(a) - g(b)| < eps for a, b in rect.
f - univariate polynomial, non-zero.
g - univariate polynomial, gcd(f,g) == 1.
eps - length limit for rectangle length.
Returns:
g(rect) .
Throws:
InvalidBoundaryException