Package sage :: Package libs :: Package flint :: Module fmpz_poly :: Class Fmpz_poly
[hide private]
[frames] | no frames]

Class Fmpz_poly



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

Instance Methods [hide private]
 
__add__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 145) Add together two Flint polynomials.
 
__copy__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 323)
 
__delitem__(x, y)
del x[y]
 
__floordiv__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 262) Return left // right, truncated.
 
__getitem__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 86) Return the $i$-th item of self, which is the coefficient of the $x^i$ term.
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__mul__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 188) Return the product of left and right.
 
__neg__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 175) Return the negative of self.
 
__new__(T, S, ...)
 
__pow__(x, y, z=...)
pow(x, y[, z])
 
__radd__(x, y)
y+x
 
__repr__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 102) Print self according to the native FLINT format.
 
__rfloordiv__(x, y)
y//x
 
__rmul__(x, y)
y*x
 
__rpow__(y, x, z=...)
pow(x, y[, z])
 
__rsub__(x, y)
y-x
 
__setitem__(x, i, y)
x[i]=y
 
__sub__(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 160) Subtract two Flint polynomials.
 
_sage_(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 363) Return self as an element of the sage ZZ[var].
 
_unsafe_mutate_truncate(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 344) Return the truncation of self at degree n.
 
degree(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 116) The degree of self.
 
div_rem(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 282) Return self / other, self, % other.
 
list(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 133) Return self as a list of coefficients, lowest terms first.
 
pow_truncate(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 241) Return self raised to the power of exp mod x^n.
 
pseudo_div(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 309)
 
pseudo_div_rem(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 315)
 
truncate(...)
File: sage/libs/flint/fmpz_poly.pyx (starting at line 328) Return the truncation of self at degree n.

Inherited from structure.sage_object.SageObject: __hash__, _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_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__add__(...)
(Addition operator)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 145)

Add together two Flint polynomials.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: Fmpz_poly([1,2,3]) + Fmpz_poly(range(6))
    6  1 3 5 3 4 5

__floordiv__(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 262)

Return left // right, truncated.

EXAMPLES: 
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([3,4,5])
    sage: g = f^5; g
    11  243 1620 6345 16560 32190 47224 53650 46000 29375 12500 3125
    sage: g // f
    9  81 432 1404 2928 4486 4880 3900 2000 625
    sage: f^4
    9  81 432 1404 2928 4486 4880 3900 2000 625

__getitem__(...)
(Indexing operator)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 86)

Return the $i$-th item of self, which is the coefficient of the $x^i$ term. 

EXAMPLES: 
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly(range(100))
    sage: f[13]
    13
    sage: f[200]
    0

__init__(...)
(Constructor)

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

Overrides: object.__init__

__mul__(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 188)

Return the product of left and right.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([0,1]); g = Fmpz_poly([2,3,4])
    sage: f*g
    4  0 2 3 4
    sage: f = Fmpz_poly([1,0,-1]); g = Fmpz_poly([2,3,4])
    sage: f*g
    5  2 3 2 -3 -4
    
Scalar multiplication
    sage: f * 3
    3  3 0 -3
    sage: f * 5r
    3  5 0 -5

__neg__(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 175)

Return the negative of self.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: -Fmpz_poly([2,10,2,3,18,-5])
    6  -2 -10 -2 -3 -18 5

__new__(T, S, ...)

 


Returns:
a new object with type S, a subtype of T

Overrides: structure.sage_object.SageObject.__new__

__repr__(...)
(Representation operator)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 102)

Print self according to the native FLINT format. 

EXAMPLES: 
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([0,1]); f^7
    8  0 0 0 0 0 0 0 1

Overrides: structure.sage_object.SageObject.__repr__

__sub__(...)
(Subtraction operator)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 160)

Subtract two Flint polynomials.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: Fmpz_poly([10,2,3]) - Fmpz_poly([4,-2,1])
    3  6 4 2

_sage_(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 363)

Return self as an element of the sage ZZ[var].

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([1,1])
    sage: f._sage_('t')
    t + 1
    sage: Fmpz_poly([-1,0,0,1])._sage_()
    x^3 - 1

Overrides: structure.sage_object.SageObject._sage_

_unsafe_mutate_truncate(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 344)

Return the truncation of self at degree n.

Don't do this unless you know there are no other references to
this polynomial!!!!!

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([1,1])
    sage: g = f**10; g
    11  1 10 45 120 210 252 210 120 45 10 1
    sage: g._unsafe_mutate_truncate(5); g
    5  1 10 45 120 210

degree(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 116)

The degree of self.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([1,2,3]); f
    3  1 2 3
    sage: f.degree()
    2
    sage: Fmpz_poly(range(1000)).degree()
    999
    sage: Fmpz_poly([2,0]).degree()
    0

div_rem(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 282)

Return self / other, self, % other.

EXAMPLES: 
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([1,3,4,5])
    sage: g = f^23
    sage: g.div_rem(f)[1]
    0 
    sage: g.div_rem(f)[0] - f^22
    0 
    sage: f = Fmpz_poly([1..10])
    sage: g = Fmpz_poly([1,3,5])
    sage: q, r = f.div_rem(g)
    sage: q*f+r
    17  1 2 3 4 4 4 10 11 17 18 22 26 30 23 26 18 20
    sage: g
    3  1 3 5
    sage: q*g+r
    10  1 2 3 4 5 6 7 8 9 10

list(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 133)

Return self as a list of coefficients, lowest terms first. 

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([2,1,0,-1])
    sage: f.list()
    [2, 1, 0, -1]

pow_truncate(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 241)

Return self raised to the power of exp mod x^n.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([1,2])
    sage: f.pow_truncate(10,3)
    3  1 20 180
    sage: f.pow_truncate(1000,3)
    3  1 2000 1998000

truncate(...)

 
File: sage/libs/flint/fmpz_poly.pyx (starting at line 328)

Return the truncation of self at degree n.

EXAMPLES:
    sage: from sage.libs.flint.fmpz_poly import Fmpz_poly
    sage: f = Fmpz_poly([1,1])
    sage: g = f**10; g
    11  1 10 45 120 210 252 210 120 45 10 1
    sage: g.truncate(5)
    5  1 10 45 120 210