Package sage :: Package rings :: Module qqbar :: Class AlgebraicPolynomialTracker
[hide private]
[frames] | no frames]

Class AlgebraicPolynomialTracker

source code

                      object --+    
                               |    
structure.sage_object.SageObject --+
                                   |
                                  AlgebraicPolynomialTracker


Keeps track of a polynomial used for algebraic numbers.

If multiple algebraic numbers are created as roots of a single
polynomial, this allows the polynomial and information about
the polynomial to be shared.  This reduces work if the polynomial
must be recomputed at higher precision, or if it must be factored.

This class is private, and should only be constructed by
AA.common_polynomial() or QQbar.common_polynomial(), and should
only be used as an argument to AA.polynomial_root() or
QQbar.polynomial_root().  (It doesn't matter whether you create
the common polynomial with AA.common_polynomial() or
QQbar.common_polynomial().)

EXAMPLES:
    sage: x = polygen(QQbar)
    sage: P = QQbar.common_polynomial(x^2 - x - 1)
    sage: P
    x^2 + (-1)*x - 1
    sage: QQbar.polynomial_root(P, RIF(1, 2))
    [1.6180339887498946 .. 1.6180339887498950]



Instance Methods [hide private]
 
__init__(self, poly)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__reduce__(self)
Add customized pickling support.
source code
 
_repr_(self) source code
 
poly(self) source code
 
is_complex(self) source code
 
complex_roots(self, prec, multiplicity)
EXAMPLES: sage: x = polygen(ZZ) sage: cp = AA.common_polynomial(x^4 - 2) sage: cp.complex_roots(30, 1) [[1.1892071150027208 ..
source code
 
exactify(self)
Compute a common field that holds all of the algebraic coefficients of this polynomial, then factor the polynomial over that field.
source code
 
factors(self) source code
 
generator(self) source code

Inherited from structure.sage_object.SageObject: __hash__, __new__, __repr__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, poly)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__reduce__(self)

source code 

Add customized pickling support.

EXAMPLES:
    sage: x = polygen(QQ)
    sage: v = (x^2 - x - 1).roots(ring=AA, multiplicities=False)[1]
    sage: type(v._descr._poly)
    <class 'sage.rings.qqbar.AlgebraicPolynomialTracker'>
    sage: loads(dumps(v)) == v
    True

Overrides: object.__reduce__

complex_roots(self, prec, multiplicity)

source code 

EXAMPLES:
    sage: x = polygen(ZZ)
    sage: cp = AA.common_polynomial(x^4 - 2)
    sage: cp.complex_roots(30, 1)
    [[1.1892071150027208 .. 1.1892071150027213], [-1.1892071150027213 .. -1.18920711500272...], [1.18920711500272... .. 1.1892071150027213]*I, [-1.1892071150027213 .. -1.1892071150027208]*I]

exactify(self)

source code 

Compute a common field that holds all of the algebraic coefficients
of this polynomial, then factor the polynomial over that field.
Store the factors for later use (ignoring multiplicity).