Package sage :: Package calculus :: Module calculus :: Class SymbolicPolynomial
[hide private]
[frames] | no frames]

Class SymbolicPolynomial

source code

                      object --+                        
                               |                        
structure.sage_object.SageObject --+                    
                                   |                    
           structure.element.Element --+                
                                       |                
         structure.element.ModuleElement --+            
                                           |            
               structure.element.RingElement --+        
                                               |        
                              SymbolicExpression --+    
                                                   |    
                                     Symbolic_object --+
                                                       |
                                                      SymbolicPolynomial


An element of a polynomial ring as a formal symbolic expression.

EXAMPLES:
A single variate polynomial:
    sage: R.<x> = QQ[]
    sage: f = SR(x^3 + x)
    sage: f(y=7)
    x^3 + x
    sage: f(x=5)
    130
    sage: f.integral(x)
    x^4/4 + x^2/2
    sage: f(x=var('y'))
    y^3 + y

A multivariate polynomial:

    sage: R.<x,y,theta> = ZZ[]
    sage: f = SR(x^3 + x + y + theta^2); f
    x^3 + theta^2 + x + y
    sage: f(x=y, theta=y)
    y^3 + y^2 + 2*y
    sage: f(x=5)
    y + theta^2 + 130
    
The polynomial must be over a field of characteristic 0.
    sage: R.<w> = GF(7)[]
    sage: f = SR(w^3 + 1)
    Traceback (most recent call last):
    ...
    TypeError: polynomial must be over a field of characteristic 0.    



Instance Methods [hide private]
 
__init__(self, p) source code
 
_recursive_sub(self, kwds) source code
 
_recursive_sub_over_ring(self, kwds, ring) source code
 
variables(self)
Return sorted list of variables that occur in \code{self}.
source code
 
number_of_arguments(self)
Returns the number of arguments this object can take.
source code
 
polynomial(self, base_ring)
Return \code{self} as a polynomial over the given base ring, if possible.
source code
 
_fast_float_(self, *vars) source code

Inherited from Symbolic_object: __complex__, __float__, __hash__, _complex_double_, _complex_mpfr_field_, _latex_, _maxima_init_, _mpfr_, _real_double_, _real_rqdf_, _repr_, _sys_init_, obj, str

Inherited from SymbolicExpression: __abs__, __call__, __cmp__, __eq__, __ge__, __gt__, __int__, __le__, __long__, __lt__, __ne__, __nonzero__, __pow__, __str__, _add_, _axiom_init_, _div_, _gap_init_, _gp_init_, _integer_, _kash_init_, _macaulay2_init_, _magma_init_, _maple_init_, _mathematica_init_, _maxima_, _mul_, _neg_, _octave_init_, _pari_init_, _polynomial_, _rational_, _richcmp_, _singular_init_, _sub_, arguments, coeff, coefficient, coefficients, coeffs, combine, conjugate, default_variable, denominator, derivative, diff, differentiate, display2d, exp_simplify, expand, expand_rational, expand_trig, factor, factor_list, find_maximum_on_interval, find_minimum_on_interval, find_root, full_simplify, function, gradient, hessian, imag, integral, integrate, inverse_laplace, laplace, limit, log_simplify, minpoly, n, nintegral, nintegrate, norm, numerator, numerical_approx, partial_fraction, plot, poly, power_series, radical_simplify, rational_expand, rational_simplify, real, roots, show, simplify, simplify_exp, simplify_full, simplify_log, simplify_radical, simplify_rational, simplify_trig, solve, subs, subs_expr, substitute, substitute_over_ring, taylor, trig_expand, trig_simplify

Inherited from structure.element.RingElement: __div__, __idiv__, __imul__, __invert__, __mul__, __new__, __pos__, __rdiv__, __rmul__, __rpow__, __rtruediv__, __truediv__, _idiv_, _imul_, abs, additive_order, is_nilpotent, is_one, is_unit, multiplicative_order, order

Inherited from structure.element.ModuleElement: __add__, __iadd__, __isub__, __neg__, __radd__, __rsub__, __sub__, _iadd_, _ilmul_, _isub_, _lmul_, _rmul_

Inherited from structure.element.Element: __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring, category, is_zero, parent

Inherited from structure.sage_object.SageObject: __repr__, _axiom_, _gap_, _gp_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _macaulay2_, _magma_, _maple_, _mathematica_, _octave_, _pari_, _r_init_, _sage_, _singular_, db, dump, dumps, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, p)
(Constructor)

source code 
Overrides: Symbolic_object.__init__

_recursive_sub(self, kwds)

source code 
Overrides: SymbolicExpression._recursive_sub

_recursive_sub_over_ring(self, kwds, ring)

source code 
Overrides: SymbolicExpression._recursive_sub_over_ring

variables(self)

source code 

Return sorted list of variables that occur in \code{self}.
The ordering is alphabetic.

EXAMPLES:
    sage: R.<x> = QQ[]; S.<y> = R[]
    sage: f = x+y*x+y^2
    sage: g = SR(f)
    sage: g.variables()
    (x, y)

Overrides: SymbolicExpression.variables

number_of_arguments(self)

source code 

Returns the number of arguments this object can take.  For
\class{SymbolicPolynomial}s, this is just the number of variables
of the polynomial.

EXAMPLES:
    sage: R.<x> = QQ[]; S.<y> = R[]
    sage: f = x+y*x+y^2
    sage: g = SR(f)
    sage: g.number_of_arguments()
    2

Overrides: Symbolic_object.number_of_arguments

polynomial(self, base_ring)

source code 

Return \code{self} as a polynomial over the given base ring, if possible.

INPUT:
   base_ring -- a ring

EXAMPLES:
    sage: R.<x> = QQ[]
    sage: f = SR(x^2 -2/3*x + 1)
    sage: f.polynomial(QQ)
    x^2 - 2/3*x + 1
    sage: f.polynomial(GF(19))
    x^2 + 12*x + 1

Overrides: SymbolicExpression.polynomial

_fast_float_(self, *vars)

source code 
Overrides: Symbolic_object._fast_float_