
\c           @  s  d  Z  d d l m Z m Z d d l m Z d d l m Z d d l m	 Z	 m
 Z
 m Z d d l m Z d e f d     YZ d d	 l m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ m% Z% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ m, Z, m- Z- m. Z. m/ Z/ m0 Z0 d d
 l1 m2 Z2 m3 Z3 m4 Z4 m5 Z5 m6 Z6 m7 Z7 m8 Z8 m9 Z9 m: Z: m; Z; m< Z< m= Z= m> Z> m? Z? m@ Z@ mA ZA mB ZB mC ZC mD ZD mE ZE mF ZF mG ZG mH ZH mI ZI mJ ZJ mK ZK mL ZL mM ZM mN ZN mO ZO d d lP mQ ZQ mR ZR mS ZS mT ZT mU ZU mV ZV mW ZW mX ZX mY ZY mZ ZZ m[ Z[ m\ Z\ m] Z] m^ Z^ d d l_ m` Z` ma Za mb Zb mc Zc md Zd me Ze mf Zf mg Zg mh Zh mi Zi d d lj mk Zk ml Zl mm Zm mn Zn mo Zo mp Zp mq Zq d d lr ms Zs mt Zt mu Zu mv Zv d d lw mx Zx my Zy mz Zz m{ Z{ m| Z| m} Z} m~ Z~ m Z d d l m Z m Z d   Z d e e f d     YZ d   Z d e e f d     YZ d   Z d e e f d     YZ d S(   s1   OO layer for several polynomial representations. i(   t   print_functiont   division(   t   oo(   t   CantSympify(   t   CoercionFailedt   NotReversiblet   NotInvertible(   t   PicklableWithSlotst   GenericPolyc           B  s8   e  Z d  Z d   Z d   Z d   Z e d    Z RS(   s5   Base class for low-level polynomial representations. c         C  s   |  j  |  j j    S(   s   Make the ground domain a ring. (   t
   set_domaint   domt   get_ring(   t   f(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   ground_to_ring   s    c         C  s   |  j  |  j j    S(   s    Make the ground domain a field. (   R	   R
   t	   get_field(   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   ground_to_field   s    c         C  s   |  j  |  j j    S(   s   Make the ground domain exact. (   R	   R
   t	   get_exact(   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   ground_to_exact   s    c         C  s^   | r | \ } } n | } g  | D] \ } } |  |  | f ^ q" } | rV | | f S| Sd  S(   N(    (   t   pert   resultt   includet   coefft   factorst   gt   k(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   _perify_factors   s    +
(   t   __name__t
   __module__t   __doc__R   R   R   t   classmethodR   (    (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR      s
   			(!   t   dmp_validatet
   dup_normalt
   dmp_normalt   dup_convertt   dmp_convertt   dmp_from_sympyt	   dup_stript
   dup_degreet   dmp_degree_int   dmp_degree_listt   dmp_negative_pt   dup_LCt   dmp_ground_LCt   dup_TCt   dmp_ground_TCt   dmp_ground_ntht   dmp_onet
   dmp_groundt
   dmp_zero_pt	   dmp_one_pt   dmp_ground_pt   dup_from_dictt   dmp_from_dictt   dmp_to_dictt   dmp_deflatet
   dmp_injectt	   dmp_ejectt   dmp_terms_gcdt   dmp_list_termst   dmp_excludet   dmp_slice_int   dmp_permutet   dmp_to_tuple(   t   dmp_add_groundt   dmp_sub_groundt   dmp_mul_groundt   dmp_quo_groundt   dmp_exquo_groundt   dmp_abst   dup_negt   dmp_negt   dup_addt   dmp_addt   dup_subt   dmp_subt   dup_mult   dmp_mult   dmp_sqrt   dup_powt   dmp_powt   dmp_pdivt   dmp_premt   dmp_pquot
   dmp_pexquot   dmp_divt   dup_remt   dmp_remt   dmp_quot	   dmp_exquot   dmp_add_mult   dmp_sub_mult   dmp_max_normt   dmp_l1_norm(   t   dmp_clear_denomst   dmp_integrate_int   dmp_diff_int   dmp_eval_int
   dup_revertt   dmp_ground_trunct   dmp_ground_contentt   dmp_ground_primitivet   dmp_ground_monict   dmp_composet   dup_decomposet	   dup_shiftt   dup_transformt   dmp_lift(
   t   dup_half_gcdext	   dup_gcdext
   dup_invertt   dmp_subresultantst   dmp_resultantt   dmp_discriminantt   dmp_inner_gcdt   dmp_gcdt   dmp_lcmt
   dmp_cancel(   t   dup_gff_listt   dmp_normt	   dmp_sqf_pt   dmp_sqf_normt   dmp_sqf_partt   dmp_sqf_listt   dmp_sqf_list_include(   t   dup_cyclotomic_pt   dmp_irreducible_pt   dmp_factor_listt   dmp_factor_list_include(   t   dup_isolate_real_roots_sqft   dup_isolate_real_rootst   dup_isolate_all_roots_sqft   dup_isolate_all_rootst   dup_refine_real_roott   dup_count_real_rootst   dup_count_complex_rootst	   dup_sturm(   t   UnificationFailedt   PolynomialErrorc         C  s   t  t |  | |  | |  S(   N(   t   DMPR    (   t   rept   levR
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   init_normal_DMP   s    R   c           B  s  e  Z d  Z d d d d g Z d d d  Z d   Z d   Z d   Z d e	 d d	  Z
 e d d
   Z e d d   Z e d    Z e d    Z e	 d  Z e	 d  Z d   Z d   Z d   Z e d    Z e d d   Z d   Z d   Z d   Z d   Z d d  Z d d  Z d d  Z d d  Z d   Z d   Z  d    Z! d!   Z" d"   Z# e	 d#  Z$ e	 d$  Z% d%   Z& d&   Z' d'   Z( d(   Z) d)   Z* d*   Z+ d+   Z, d,   Z- d-   Z. d.   Z/ d/   Z0 d0   Z1 d1   Z2 d2   Z3 d3   Z4 d4   Z5 d5   Z6 d6   Z7 d7   Z8 d8   Z9 d9   Z: d:   Z; d;   Z< d d<  Z= d=   Z> d>   Z? d?   Z@ d@   ZA dA   ZB dB   ZC dC   ZD dD   ZE dE   ZF dF   ZG dG d dH  ZH dG d dI  ZI d dJ  ZJ dK   ZK dL   ZL dM   ZM dN   ZN dO   ZO e	 dP  ZP dQ   ZQ dR   ZR dS   ZS dT   ZT eU dU  ZV dV   ZW dW   ZX dX   ZY dY   ZZ dZ   Z[ d[   Z\ d\   Z] d]   Z^ d^   Z_ d_   Z` d`   Za da   Zb db   Zc e	 dc  Zd e	 dd  Ze de   Zf df   Zg e	 d d d e	 e	 dg  Zh d d e	 dh  Zi d d di  Zj d d dj  Zk el dk    Zm el dl    Zn el dm    Zo el dn    Zp el do    Zq el dp    Zr el dq    Zs el dr    Zt el ds    Zu el dt    Zv el du    Zw el dv    Zx dw   Zy dx   Zz dy   Z{ dz   Z| d{   Z} d|   Z~ d}   Z d~   Z d   Z e Z e Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e	 d  Z e	 d  Z d   Z d   Z d   Z d   Z d   Z d   Z e Z RS(   s)   Dense Multivariate Polynomials over `K`. R   R   R
   t   ringc         C  s   | d  k	 rc t |  t k r3 t | | |  } qu t |  t k	 ru t | j |  |  } qu n t |  \ } } | |  _ | |  _	 | |  _
 | |  _ d  S(   N(   t   Nonet   typet   dictR4   t   listR/   t   convertR   R   R   R
   R   (   t   selfR   R
   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __init__   s    			c         C  s#   d |  j  j |  j |  j |  j f S(   Ns   %s(%s, %s, %s)(   t	   __class__R   R   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __repr__   s    c         C  s.   t  |  j j |  j   |  j |  j |  j f  S(   N(   t   hashR   R   t   to_tupleR   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __hash__   s    c           sJ  t  | t  s" |  j | j k r; t d |  | f   n  |  j | j k r |  j | j k r |  j |  j |  j |  j | j f S|  j |  j j | j  } } |  j   | j d k	 r   d k	 r   j | j    q | j   n  t
 |  j | |  j |  } t
 | j | | j |  } | | t   f d  } | | | | | f Sd S(   s7   Unify representations of two multivariate polynomials. s   can't unify %s with %sc           s0   | r | s |  S| d 8} n  t  |  | |    S(   Ni   (   R   (   R   R
   R   t   kill(   R   (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR      s
    N(   t
   isinstanceR   R   R   R
   R   R   R   t   unifyR   R"   t   False(   R   R   R   R
   t   Ft   GR   (    (   R   s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR      s    "$"		c         C  si   |  j  } | r& | s | S| d 8} n  | d k r> |  j } n  | d k rV |  j } n  t | | | |  S(   s.   Create a DMP out of the given representation. i   N(   R   R   R
   R   R   (   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR      s    	c         C  s   t  d | | |  S(   Ni    (   R   (   t   clsR   R
   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   zero   s    c         C  s   t  d | | |  S(   Ni   (   R   (   R   R   R
   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   one   s    c         C  s   |  t  | | d |  | |  S(   sC   Create an instance of ``cls`` given a list of native coefficients. N(   R"   R   (   R   R   R   R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   from_list   s    c         C  s   |  t  | | |  | |  S(   sB   Create an instance of ``cls`` given a list of SymPy coefficients. (   R#   (   R   R   R   R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   from_sympy_list   s    c         C  s   t  |  j |  j |  j d | S(   sA   Convert ``f`` to a dict representation with native coefficients. R   (   R5   R   R   R
   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_dict   s    c         C  sX   t  |  j |  j |  j d | } x0 | j   D]" \ } } |  j j |  | | <q. W| S(   s@   Convert ``f`` to a dict representation with SymPy coefficients. R   (   R5   R   R   R
   t   itemst   to_sympy(   R   R   R   R   t   v(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_sympy_dict   s    !c         C  s   |  j  S(   sA   Convert ``f`` to a list representation with native coefficients. (   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_list   s    c           s      f d       j   S(   s@   Convert ``f`` to a list representation with SymPy coefficients. c           sY   g  } xL |  D]D } t  | t  r8 | j  |   q | j   j j |   q W| S(   N(   R   R   t   appendR
   R   (   R   t   outt   val(   R   t   sympify_nested_list(    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR      s    (   R   (   R   (    (   R   R   s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_sympy_list   s    	c         C  s   t  |  j |  j  S(   sx   
        Convert ``f`` to a tuple representation with native coefficients.

        This is needed for hashing.
        (   R>   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   
  s    c         C  s   |  t  | | |  | |  S(   sB   Construct and instance of ``cls`` from a ``dict`` representation. (   R4   (   R   R   R   R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   from_dict  s    c         C  s(   t  t t t | |    | | |  S(   N(   R   R   R   t   zip(   R   t   monomst   coeffsR   R
   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   from_monoms_coeffs  s    c         C  s   |  j  |  j j    S(   s   Make the ground domain a ring. (   R   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_ring  s    c         C  s   |  j  |  j j    S(   s    Make the ground domain a field. (   R   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_field  s    c         C  s   |  j  |  j j    S(   s   Make the ground domain exact. (   R   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   to_exact#  s    c         C  sB   |  j  | k r |  St t |  j |  j |  j  |  | |  j  Sd S(   s$   Convert the ground domain of ``f``. N(   R
   R   R"   R   R   (   R   R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   '  s    i    c         C  s+   |  j  t |  j | | | |  j |  j   S(   s1   Take a continuous subsequence of terms of ``f``. (   R   R<   R   R   R
   (   R   t   mt   nt   j(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   slice.  s    c         C  s8   g  t  |  j |  j |  j d | D] \ } } | ^ q" S(   s;   Returns all non-zero coefficients from ``f`` in lex order. t   order(   R:   R   R   R
   (   R   R   t   _t   c(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   2  s    c         C  s8   g  t  |  j |  j |  j d | D] \ } } | ^ q" S(   s8   Returns all non-zero monomials from ``f`` in lex order. R   (   R:   R   R   R
   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   6  s    c         C  s   t  |  j |  j |  j d | S(   s4   Returns all non-zero terms from ``f`` in lex order. R   (   R:   R   R   R
   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   terms:  s    c         C  sI   |  j  s9 |  s |  j j g Sg  |  j D] } | ^ q& Sn t d   d S(   s%   Returns all coefficients from ``f``. s&   multivariate polynomials not supportedN(   R   R
   R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   all_coeffs>  s
    	c         C  sk   |  j  s[ t |  j  } | d k  r+ d g Sg  t |  j  D] \ } } | | f ^ q; Sn t d   d S(   s"   Returns all monomials from ``f``. i    s&   multivariate polynomials not supportedN(   i    (   R   R%   R   t	   enumerateR   (   R   R   t   iR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   all_monomsH  s    	0c         C  s}   |  j  sm t |  j  } | d k  r7 d |  j j f g Sg  t |  j  D] \ } } | | f | f ^ qG Sn t d   d S(   s    Returns all terms from a ``f``. i    s&   multivariate polynomials not supportedN(   i    (   R   R%   R   R
   R   R   R   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   all_termsT  s    	6c         C  s.   |  j  t |  j |  j |  j  d |  j j S(   s-   Convert algebraic coefficients to rationals. R
   (   R   Rj   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   lift`  s    c         C  s4   t  |  j |  j |  j  \ } } | |  j |  f S(   s2   Reduce degree of `f` by mapping `x_i^m` to `y_i`. (   R6   R   R   R
   R   (   R   t   JR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   deflated  s    !c         C  s@   t  |  j |  j |  j d | \ } } |  j | |  j j |  S(   s,   Inject ground domain generators into ``f``. t   front(   R7   R   R   R
   R   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   injecti  s    'c         C  sA   t  |  j |  j | d | } |  j | | |  j t | j   S(   s2   Eject selected generators into the ground domain. R   (   R8   R   R   R   t   lent   symbols(   R   R
   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   ejectn  s    c         C  s@   t  |  j |  j |  j  \ } } } | |  j | |  j |  f S(   so  
        Remove useless generators from ``f``.

        Returns the removed generators and the new excluded ``f``.

        Examples
        ========

        >>> from sympy.polys.polyclasses import DMP
        >>> from sympy.polys.domains import ZZ

        >>> DMP([[[ZZ(1)]], [[ZZ(1)], [ZZ(2)]]], ZZ).exclude()
        ([2], DMP([[1], [1, 2]], ZZ, None))

        (   R;   R   R   R
   R   (   R   R   R   t   u(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   excludes  s    $c         C  s%   |  j  t |  j | |  j |  j   S(   s  
        Returns a polynomial in `K[x_{P(1)}, ..., x_{P(n)}]`.

        Examples
        ========

        >>> from sympy.polys.polyclasses import DMP
        >>> from sympy.polys.domains import ZZ

        >>> DMP([[[ZZ(2)], [ZZ(1), ZZ(0)]], [[]]], ZZ).permute([1, 0, 2])
        DMP([[[2], []], [[1, 0], []]], ZZ, None)

        >>> DMP([[[ZZ(2)], [ZZ(1), ZZ(0)]], [[]]], ZZ).permute([1, 2, 0])
        DMP([[[1], []], [[2, 0], []]], ZZ, None)

        (   R   R=   R   R   R
   (   R   t   P(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   permute  s    c         C  s4   t  |  j |  j |  j  \ } } | |  j |  f S(   s/   Remove GCD of terms from the polynomial ``f``. (   R9   R   R   R
   R   (   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   terms_gcd  s    !c         C  s1   |  j  t |  j |  j j |  |  j |  j   S(   s.   Add an element of the ground domain to ``f``. (   R   R?   R   R
   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   add_ground  s    c         C  s1   |  j  t |  j |  j j |  |  j |  j   S(   s5   Subtract an element of the ground domain from ``f``. (   R   R@   R   R
   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   sub_ground  s    c         C  s1   |  j  t |  j |  j j |  |  j |  j   S(   s5   Multiply ``f`` by a an element of the ground domain. (   R   RA   R   R
   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   mul_ground  s    c         C  s1   |  j  t |  j |  j j |  |  j |  j   S(   s8   Quotient of ``f`` by a an element of the ground domain. (   R   RB   R   R
   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   quo_ground  s    c         C  s1   |  j  t |  j |  j j |  |  j |  j   S(   s>   Exact quotient of ``f`` by a an element of the ground domain. (   R   RC   R   R
   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   exquo_ground  s    c         C  s"   |  j  t |  j |  j |  j   S(   s)   Make all coefficients in ``f`` positive. (   R   RD   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   abs  s    c         C  s"   |  j  t |  j |  j |  j   S(   s"   Negate all coefficients in ``f``. (   R   RF   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   neg  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s2   Add two multivariate polynomials ``f`` and ``g``. (   R   RH   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   add  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s7   Subtract two multivariate polynomials ``f`` and ``g``. (   R   RJ   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sub  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s7   Multiply two multivariate polynomials ``f`` and ``g``. (   R   RL   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   mul  s    c         C  s"   |  j  t |  j |  j |  j   S(   s(   Square a multivariate polynomial ``f``. (   R   RM   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sqr  s    c         C  sN   t  | t  r4 |  j t |  j | |  j |  j   St d t |    d S(   s+   Raise ``f`` to a non-negative power ``n``. s   ``int`` expected, got %sN(	   R   t   intR   RO   R   R   R
   t	   TypeErrorR   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   pow  s    %c   	      C  sO   |  j  |  \ } } } } } t | | | |  \ } } | |  | |  f S(   s/   Polynomial pseudo-division of ``f`` and ``g``. (   R   RP   (	   R   R   R   R
   R   R   R   t   qt   r(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   pdiv  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s0   Polynomial pseudo-remainder of ``f`` and ``g``. (   R   RQ   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   prem  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s/   Polynomial pseudo-quotient of ``f`` and ``g``. (   R   RR   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   pquo  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s5   Polynomial exact pseudo-quotient of ``f`` and ``g``. (   R   RS   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   pexquo  s    c   	      C  sO   |  j  |  \ } } } } } t | | | |  \ } } | |  | |  f S(   s7   Polynomial division with remainder of ``f`` and ``g``. (   R   RT   (	   R   R   R   R
   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   div  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s2   Computes polynomial remainder of ``f`` and ``g``. (   R   RV   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   rem  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s1   Computes polynomial quotient of ``f`` and ``g``. (   R   RW   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   quo  s    c   	      C  s}   |  j  |  \ } } } } } | t | | | |   } |  j ry | |  j k ry d d l m } | |  | |  j   n  | S(   s7   Computes polynomial exact quotient of ``f`` and ``g``. i(   t   ExactQuotientFailed(   R   RX   R   t   sympy.polys.polyerrorsR   (	   R   R   R   R
   R   R   R   t   resR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   exquo  s    c         C  s?   t  | t  r% t |  j | |  j  St d t |    d S(   s0   Returns the leading degree of ``f`` in ``x_j``. s   ``int`` expected, got %sN(   R   R   R&   R   R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   degree  s    c         C  s   t  |  j |  j  S(   s$   Returns a list of degrees of ``f``. (   R'   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   degree_list	  s    c         C  s   t  d   |  j   D  S(   s#   Returns the total degree of ``f``. c         s  s   |  ] } t  |  Vq d  S(   N(   t   sum(   t   .0R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pys	   <genexpr>  s    (   t   maxR   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   total_degree  s    c   	      C  s   |  j    } i  } | t |  j   d d  k } x |  j   D] } t | d  } | | k  rn | | } n d } | r | d | | d | f <q? t | d  } | | c | 7<| d | t |  <q? Wt | |  j |  j t	 |  |  j
  S(   s&   Return homogeneous polynomial of ``f``i    i   (   R   R   R   R   R   t   tupleR   R
   R   R   R   (	   R   t   st   tdR   t
   new_symbolt   termt   dR   t   l(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   homogenize  s     c         C  s[   |  j  r t S|  j   } t | d  } x* | D]" } t |  } | | k r1 d Sq1 W| S(   s(   Returns the homogeneous order of ``f``. i    N(   t   is_zeroR   R   R   R   (   R   R   t   tdegt   monomt   _tdeg(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   homogeneous_order$  s    	c         C  s   t  |  j |  j |  j  S(   s*   Returns the leading coefficient of ``f``. (   R*   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   LC4  s    c         C  s   t  |  j |  j |  j  S(   s+   Returns the trailing coefficient of ``f``. (   R,   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   TC8  s    c         G  sB   t  d   | D  r2 t |  j | |  j |  j  St d   d S(   s+   Returns the ``n``-th coefficient of ``f``. c         s  s   |  ] } t  | t  Vq d  S(   N(   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pys	   <genexpr>>  s    s   a sequence of integers expectedN(   t   allR-   R   R   R
   R   (   R   t   N(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   nth<  s    c         C  s   t  |  j |  j |  j  S(   s   Returns maximum norm of ``f``. (   R[   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   max_normC  s    c         C  s   t  |  j |  j |  j  S(   s   Returns l1 norm of ``f``. (   R\   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   l1_normG  s    c         C  s4   t  |  j |  j |  j  \ } } | |  j |  f S(   s0   Clear denominators, but keep the ground domain. (   R]   R   R   R
   R   (   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   clear_denomsK  s    !i   c         C  sx   t  | t  s( t d t |    n  t  | t  sP t d t |    n  |  j t |  j | | |  j |  j   S(   sE   Computes the ``m``-th order indefinite integral of ``f`` in ``x_j``. s   ``int`` expected, got %s(	   R   R   R   R   R   R^   R   R   R
   (   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   integrateP  s
    c         C  sx   t  | t  s( t d t |    n  t  | t  sP t d t |    n  |  j t |  j | | |  j |  j   S(   s<   Computes the ``m``-th order derivative of ``f`` in ``x_j``. s   ``int`` expected, got %s(	   R   R   R   R   R   R_   R   R   R
   (   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   diffZ  s
    c         C  sb   t  | t  s( t d t |    n  |  j t |  j |  j j |  | |  j	 |  j  d t
 S(   s5   Evaluates ``f`` at the given point ``a`` in ``x_j``. s   ``int`` expected, got %sR   (   R   R   R   R   R   R`   R   R
   R   R   t   True(   R   t   aR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   evald  s    c   	      C  sb   |  j  |  \ } } } } } | sR t | | |  \ } } | |  | |  f St d   d S(   s2   Half extended Euclidean algorithm, if univariate. s   univariate polynomial expectedN(   R   Rk   t
   ValueError(	   R   R   R   R
   R   R   R   R   t   h(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   half_gcdexl  s
    c   
      C  sn   |  j  |  \ } } } } } | s^ t | | |  \ } } }	 | |  | |  | |	  f St d   d S(   s-   Extended Euclidean algorithm, if univariate. s   univariate polynomial expectedN(   R   Rl   R  (
   R   R   R   R
   R   R   R   R   t   tR  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   gcdexv  s
    c         C  sJ   |  j  |  \ } } } } } | s: | t | | |   St d   d S(   s(   Invert ``f`` modulo ``g``, if possible. s   univariate polynomial expectedN(   R   Rm   R  (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   invert  s    c         C  s8   |  j  s( |  j t |  j | |  j   St d   d S(   s"   Compute ``f**(-1)`` mod ``x**n``. s   univariate polynomial expectedN(   R   R   Ra   R   R
   R  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   revert  s    	c         C  sF   |  j  |  \ } } } } } t | | | |  } t t | |   S(   s7   Computes subresultant PRS sequence of ``f`` and ``g``. (   R   Rn   R   t   map(   R   R   R   R
   R   R   R   t   R(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   subresultants  s    c   
      C  s   |  j  |  \ } } } } } | rj t | | | | d | \ } }	 | | d t t t | |	   f S| t | | | |  d t S(   s/   Computes resultant of ``f`` and ``g`` via PRS. t
   includePRSR   (   R   Ro   R  R   R  (
   R   R   R  R   R
   R   R   R   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   resultant  s
    !%c         C  s(   |  j  t |  j |  j |  j  d t S(   s    Computes discriminant of ``f``. R   (   R   Rp   R   R   R
   R  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   discriminant  s    c   
      C  s[   |  j  |  \ } } } } } t | | | |  \ } } }	 | |  | |  | |	  f S(   s4   Returns GCD of ``f`` and ``g`` and their cofactors. (   R   Rq   (
   R   R   R   R
   R   R   R   R  t   cfft   cfg(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   cofactors  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s+   Returns polynomial GCD of ``f`` and ``g``. (   R   Rr   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   gcd  s    c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s+   Returns polynomial LCM of ``f`` and ``g``. (   R   Rs   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   lcm  s    c   
      C  s   |  j  |  \ } } } } } | rH t | | | | d t \ } } n' t | | | | d t \ } }	 } } | |  | |  } } | r | | f S| |	 | | f Sd S(   s6   Cancel common factors in a rational function ``f/g``. R   N(   R   Rt   R  R   (
   R   R   R   R   R
   R   R   R   t   cFt   cG(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   cancel  s    $'
c         C  s1   |  j  t |  j |  j j |  |  j |  j   S(   s&   Reduce ``f`` modulo a constant ``p``. (   R   Rb   R   R
   R   R   (   R   t   p(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   trunc  s    c         C  s"   |  j  t |  j |  j |  j   S(   s'   Divides all coefficients by ``LC(f)``. (   R   Re   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   monic  s    c         C  s   t  |  j |  j |  j  S(   s(   Returns GCD of polynomial coefficients. (   Rc   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   content  s    c         C  s4   t  |  j |  j |  j  \ } } | |  j |  f S(   s/   Returns content and a primitive form of ``f``. (   Rd   R   R   R
   R   (   R   t   contR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   primitive  s    !c         C  s7   |  j  |  \ } } } } } | t | | | |   S(   s4   Computes functional composition of ``f`` and ``g``. (   R   Rf   (   R   R   R   R
   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   compose  s    c         C  s>   |  j  s. t t |  j t |  j |  j    St d   d S(   s,   Computes functional decomposition of ``f``. s   univariate polynomial expectedN(   R   R   R  R   Rg   R   R
   R  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   decompose  s    	%c         C  sD   |  j  s4 |  j t |  j |  j j |  |  j   St d   d S(   s/   Efficiently compute Taylor shift ``f(x + a)``. s   univariate polynomial expectedN(   R   R   Rh   R   R
   R   R  (   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   shift  s    	+c   	      C  s   |  j  r t d   n  | j |  \ } } } } } |  j | | | |   \ } } } } } | | | |  j | | | |   \ } } } } } | s | t | | | |   St d   d S(   s5   Evaluate functional transformation ``q**n * f(p/q)``.s   univariate polynomial expectedN(   R   R  R   Ri   (	   R   R#  R   R   R
   R   R   t   QR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   transform  s    	*6c         C  s>   |  j  s. t t |  j t |  j |  j    St d   d S(   s&   Computes the Sturm sequence of ``f``. s   univariate polynomial expectedN(   R   R   R  R   R   R   R
   R  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sturm  s    	%c         C  sT   |  j  sD g  t |  j |  j  D]! \ } } |  j |  | f ^ q St d   d S(   s4   Computes greatest factorial factorization of ``f``. s   univariate polynomial expectedN(   R   Ru   R   R
   R   R  (   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   gff_list  s    	;c         C  s4   t  |  j |  j |  j  } |  j | d |  j j S(   s   Computes ``Norm(f)``.R
   (   Rv   R   R   R
   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   norm  s    c         C  sO   t  |  j |  j |  j  \ } } } | |  j |  |  j | d |  j j f S(   s$   Computes square-free norm of ``f``. R
   (   Rx   R   R   R
   R   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sqf_norm  s    $c         C  s"   |  j  t |  j |  j |  j   S(   s$   Computes square-free part of ``f``. (   R   Ry   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sqf_part  s    c         C  sV   t  |  j |  j |  j |  \ } } | g  | D]! \ } } |  j |  | f ^ q. f S(   s0   Returns a list of square-free factors of ``f``. (   Rz   R   R   R
   R   (   R   R  R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sqf_list  s    $c         C  sJ   t  |  j |  j |  j |  } g  | D]! \ } } |  j |  | f ^ q% S(   s0   Returns a list of square-free factors of ``f``. (   R{   R   R   R
   R   (   R   R  R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   sqf_list_include  s    c         C  sS   t  |  j |  j |  j  \ } } | g  | D]! \ } } |  j |  | f ^ q+ f S(   s0   Returns a list of irreducible factors of ``f``. (   R~   R   R   R
   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   factor_list  s    !c         C  sG   t  |  j |  j |  j  } g  | D]! \ } } |  j |  | f ^ q" S(   s0   Returns a list of irreducible factors of ``f``. (   R   R   R   R
   R   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   factor_list_include  s    c         C  s   |  j  s | sn | s@ t |  j |  j d | d | d | d | St |  j |  j d | d | d | d | Sq | s t |  j |  j d | d | d | d | St |  j |  j d | d | d | d | Sn t d   d S(   s0   Compute isolating intervals for roots of ``f``. t   epst   inft   supt   fasts0   can't isolate roots of a multivariate polynomialN(   R   R   R   R
   R   R   R   R   (   R   R  R7  R8  R9  R:  t   sqf(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   intervals$  s    	+.+.c         C  sD   |  j  s4 t |  j | | |  j d | d | d | St d   d S(   su   
        Refine an isolating interval to the given precision.

        ``eps`` should be a rational number.

        R7  t   stepsR:  s0   can't refine a root of a multivariate polynomialN(   R   R   R   R
   R   (   R   R   R  R7  R=  R:  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   refine_root5  s    	+c         C  s   t  |  j |  j d | d | S(   s<   Return the number of real roots of ``f`` in ``[inf, sup]``. R8  R9  (   R   R   R
   (   R   R8  R9  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   count_real_rootsB  s    c         C  s   t  |  j |  j d | d | S(   s?   Return the number of complex roots of ``f`` in ``[inf, sup]``. R8  R9  (   R   R   R
   (   R   R8  R9  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   count_complex_rootsF  s    c         C  s   t  |  j |  j  S(   s0   Returns ``True`` if ``f`` is a zero polynomial. (   R0   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   J  s    c         C  s   t  |  j |  j |  j  S(   s0   Returns ``True`` if ``f`` is a unit polynomial. (   R1   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_oneO  s    c         C  s   t  |  j d |  j  S(   s>   Returns ``True`` if ``f`` is an element of the ground domain. N(   R2   R   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   is_groundT  s    c         C  s   t  |  j |  j |  j  S(   s7   Returns ``True`` if ``f`` is a square-free polynomial. (   Rw   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_sqfY  s    c         C  s%   |  j  j t |  j |  j |  j    S(   s=   Returns ``True`` if the leading coefficient of ``f`` is one. (   R
   RA  R*   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_monic^  s    c         C  s%   |  j  j t |  j |  j |  j    S(   sA   Returns ``True`` if the GCD of the coefficients of ``f`` is one. (   R
   RA  Rc   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_primitivec  s    c         C  s/   t  d   t |  j |  j |  j  j   D  S(   s:   Returns ``True`` if ``f`` is linear in all its variables. c         s  s!   |  ] } t  |  d  k Vq d S(   i   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pys	   <genexpr>k  s    (   R  R5   R   R   R
   t   keys(   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt	   is_linearh  s    c         C  s/   t  d   t |  j |  j |  j  j   D  S(   s=   Returns ``True`` if ``f`` is quadratic in all its variables. c         s  s!   |  ] } t  |  d  k Vq d S(   i   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pys	   <genexpr>p  s    (   R  R5   R   R   R
   RF  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_quadraticm  s    c         C  s   t  |  j    d k S(   s8   Returns ``True`` if ``f`` is zero or has only one term. i   (   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_monomialr  s    c         C  s   |  j    d k	 S(   s7   Returns ``True`` if ``f`` is a homogeneous polynomial. N(   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_homogeneousw  s    c         C  s   t  |  j |  j |  j  S(   s:   Returns ``True`` if ``f`` has no factors over its domain. (   R}   R   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_irreducible|  s    c         C  s$   |  j  s t |  j |  j  St Sd S(   s6   Returns ``True`` if ``f`` is a cyclotomic polynomial. N(   R   R|   R   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   is_cyclotomic  s    	c         C  s
   |  j    S(   N(   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __abs__  s    c         C  s
   |  j    S(   N(   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __neg__  s    c         C  s   t  | t  s y+ |  j t |  j j |  |  j   } Wq t k
 rN t St	 t
 f k
 r |  j d  k	 r y |  j j |  } Wq t	 t
 f k
 r t SXq q Xn  |  j |  S(   N(   R   R   R   R/   R
   R   R   R   t   NotImplementedR   t   NotImplementedErrorR   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __add__  s    +c         C  s   |  j  |  S(   N(   RQ  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __radd__  s    c         C  s   t  | t  s y+ |  j t |  j j |  |  j   } Wq t k
 rN t St	 t
 f k
 r |  j d  k	 r y |  j j |  } Wq t	 t
 f k
 r t SXq q Xn  |  j |  S(   N(   R   R   R   R/   R
   R   R   R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __sub__  s    +c         C  s   |  j  |  S(   N(   RQ  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __rsub__  s    c         C  s   t  | t  r |  j |  Sy |  j |  SWnr t k
 rA t St t f k
 r |  j d  k	 r y |  j |  j j
 |   SWq t t f k
 r q Xn  t SXd  S(   N(   R   R   R   R   R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __mul__  s    c         C  s   t  | t  r |  j |  Sy |  j |  SWnr t k
 rA t St t f k
 r |  j d  k	 r y |  j |  j j
 |   SWq t t f k
 r q Xn  t SXd  S(   N(   R   R   R   R   R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __div__  s    c         C  si   t  | t  r | j |   S|  j d  k	 re y |  j j |  j |   SWqe t t f k
 ra qe Xn  t S(   N(	   R   R   R   R   R   R   R   RP  RO  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __rdiv__  s    c         C  s   |  j  |  S(   N(   RU  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __rmul__  s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __pow__  s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   __divmod__  s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __mod__  s    c         C  sF   t  | t  r |  j |  Sy |  j |  SWn t k
 rA t SXd  S(   N(   R   R   R   R   R   RO  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __floordiv__  s    c         C  sV   y> |  j  |  \ } } } } } |  j | j k r= | | k SWn t k
 rQ n Xt S(   N(   R   R   R   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __eq__  s    c         C  s   |  | k S(   N(    (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __ne__   s    c         C  s!   | s |  | k S|  j  |  Sd  S(   N(   t
   _strict_eq(   R   R   t   strict(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   eq  s    
c         C  s   |  j  | d | S(   NR`  (   Ra  (   R   R   R`  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   ne	  s    c         C  sF   t  | |  j  oE |  j | j k oE |  j | j k oE |  j | j k S(   N(   R   R   R   R
   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR_    s    $c         C  s(   |  j  |  \ } } } } } | | k  S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __lt__  s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __le__  s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __gt__  s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __ge__  s    c         C  s   t  |  j |  j  S(   N(   R0   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   __nonzero__!  s    N(   R   R   R   t	   __slots__R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  R  R  R  R  R	  R
  R  R  R  R  R  R  R  R  R  R  R  R  R"  R$  R%  R&  R(  R)  R*  R+  R-  R.  R/  R0  R1  R2  R3  R4  R5  R6  R<  R>  R?  R@  t   propertyR   RA  RB  RC  RD  RE  RG  RH  RI  RJ  RK  RL  RM  RN  RQ  RR  RS  RT  RU  RV  RW  t   __truediv__t   __rtruediv__RX  RY  RZ  R[  R\  R]  R^  Ra  Rb  R_  Rc  Rd  Re  Rf  Rg  t   __bool__(    (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR      s   												
																																						

	
	
																																
														c         C  s+   t  t |  | |  t | | |  | |  S(   N(   t   DMFR    (   t   numt   denR   R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   init_normal_DMF'  s    Rm  c           B  s  e  Z d  Z d d d d d g Z d. d. d  Z e d. d. d   Z e d. d   Z d	   Z	 d
   Z
 d   Z d   Z e e d. d  Z e d  Z e d. d   Z e d. d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e Z e d  Z e d    Z e d    Z  d   Z! d   Z" d   Z# d    Z$ d!   Z% d"   Z& d#   Z' d$   Z( d%   Z) d&   Z* e) Z+ e* Z, d'   Z- d(   Z. d)   Z/ d*   Z0 d+   Z1 d,   Z2 d-   Z3 e3 Z4 RS(/   s'   Dense Multivariate Fractions over `K`. Rn  Ro  R   R
   R   c         C  sj   |  j  | | |  \ } } } t | | | |  \ } } | |  _ | |  _ | |  _ | |  _ | |  _ d  S(   N(   t   _parseRt   Rn  Ro  R   R
   R   (   R   R   R
   R   R   Rn  Ro  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   1  s    				c         C  s^   |  j  | | |  \ } } } t j |   } | | _ | | _ | | _ | | _ | | _ | S(   N(   Rq  t   objectt   __new__Rn  Ro  R   R
   R   (   R   R   R
   R   R   Rn  Ro  t   obj(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   new;  s    					c         C  s  t  |  t k r;| \ } } | d  k	 r{ t  |  t k rQ t | | |  } n  t  |  t k r t | | |  } q nE t |  \ } } t |  \ } } | | k r | } n t d   t | |  r t d   n  t | |  r t	 | |  } qt
 | | |  rt | | |  } t | | |  } qn | } | d  k	 rt  |  t k rtt | | |  } qt  |  t k	 rt | j |  |  } qn t |  \ } } t	 | |  } | | | f S(   Ns   inconsistent number of levelss   fraction denominator(   R   R   R   R   R4   R   R  R0   t   ZeroDivisionErrorR.   R(   RF   R   R/   R   (   R   R   R
   R   Rn  Ro  t   num_levt   den_lev(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRq  I  s8    	c         C  s)   d |  j  j |  j |  j |  j |  j f S(   Ns   %s((%s, %s), %s, %s)(   R   R   Rn  Ro  R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   u  s    c         C  sI   t  |  j j t |  j |  j  t |  j |  j  |  j |  j |  j f  S(   N(	   R   R   R   R>   Rn  R   Ro  R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   y  s    c           st  t  | t  s"  j | j k r; t d  | f   n   j | j k r  j | j k r  j  j  j  j  j f | j	 f S j  j j
 | j  }    j  | j d k	 r  d k	 r  j
 | j   q | j  n  t  j |  j    t  j |  j    f } t | j	 | | j    } t t |     f d  } |   | | | f Sd S(   s0   Unify a multivariate fraction and a polynomial. s   can't unify %s with %sc           sg   | r! | s |  | S| d } n  | rE t  |  | |    \ }  } n   j j |  | f   | d  S(   Ni   R   (   Rt   R   Ru  (   Rn  Ro  R"  R   R   (   R
   R   R   (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    N(   R   R   R   R   R
   R   R   Rn  Ro  R   R   R   R"   R  R   (   R   R   R   R   R   R   (    (   R
   R   R   s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   poly_unify}  s    "$+	c           s  t  | t  s"  j | j k r; t d  | f   n   j | j k r  j | j k r  j  j  j  j  j f | j | j f f S j  j j	 | j  }    j  | j d k	 r  d k	 r  j	 | j   q | j  n  t  j |  j    t  j |  j    f } t | j | | j    t | j | | j    f } t t |     f d  } |   | | | f Sd S(   s5   Unify representations of two multivariate fractions. s   can't unify %s with %sc           sg   | r! | s |  | S| d } n  | rE t  |  | |    \ }  } n   j j |  | f   | d  S(   Ni   R   (   Rt   R   Ru  (   Rn  Ro  R"  R   R   (   R
   R   R   (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    N(   R   Rm  R   R   R
   R   R   Rn  Ro  R   R   R"   R  R   (   R   R   R   R   R   R   (    (   R
   R   R   s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt
   frac_unify  s"    "$!	c         C  s   |  j  |  j } } | r4 | s' | | S| d 8} n  | rX t | | | |  \ } } n  | d k rp |  j } n  |  j j | | f | | d | S(   s.   Create a DMF out of the given representation. i   R   N(   R   R
   Rt   R   R   R   Ru  (   R   Rn  Ro  R"  R   R   R   R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s9   |  j  } | r& | s | S| d 8} n  t | |  j |  S(   s.   Create a DMP out of the given representation. i   (   R   R   R
   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   half_per  s    	c         C  s   |  j  d | | d | S(   Ni    R   (   Ru  (   R   R   R
   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s   |  j  d | | d | S(   Ni   R   (   Ru  (   R   R   R
   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s   |  j  |  j  S(   s    Returns the numerator of ``f``. (   R{  Rn  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   numer  s    c         C  s   |  j  |  j  S(   s"   Returns the denominator of ``f``. (   R{  Ro  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   denom  s    c         C  s   |  j  |  j |  j  S(   s4   Remove common factors from ``f.num`` and ``f.den``. (   R   Rn  Ro  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR"    s    c         C  s.   |  j  t |  j |  j |  j  |  j d t S(   s"   Negate all coefficients in ``f``. R"  (   R   RF   Rn  R   R
   Ro  R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s   t  | t  rU |  j |  \ } } } \ } } } t | | | | |  | } }	 n |  j |  \ } } } }
 } |
 | \ } } \ } } t t | | | |  t | | | |  | |  } t | | | |  }	 | | |	  S(   s0   Add two multivariate fractions ``f`` and ``g``. (   R   R   Ry  RY   Rz  RH   RL   (   R   R   R   R
   R   t   F_numt   F_denR   Rn  Ro  R   t   G_numt   G_den(    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    $"c         C  s   t  | t  rU |  j |  \ } } } \ } } } t | | | | |  | } }	 n |  j |  \ } } } }
 } |
 | \ } } \ } } t t | | | |  t | | | |  | |  } t | | | |  }	 | | |	  S(   s5   Subtract two multivariate fractions ``f`` and ``g``. (   R   R   Ry  RZ   Rz  RJ   RL   (   R   R   R   R
   R   R~  R  R   Rn  Ro  R   R  R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   
  s    $"c         C  s   t  | t  rR |  j |  \ } } } \ } } } t | | | |  | } }	 na |  j |  \ } } } }
 } |
 | \ } } \ } } t | | | |  } t | | | |  }	 | | |	  S(   s5   Multiply two multivariate fractions ``f`` and ``g``. (   R   R   Ry  RL   Rz  (   R   R   R   R
   R   R~  R  R   Rn  Ro  R   R  R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    $c         C  so   t  | t  rU |  j t |  j | |  j |  j  t |  j | |  j |  j  d t St	 d t
 |    d S(   s+   Raise ``f`` to a non-negative power ``n``. R"  s   ``int`` expected, got %sN(   R   R   R   RO   Rn  R   R
   Ro  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   '  s    !%c         C  s  t  | t  rR |  j |  \ } } } \ } } } | t | | | |  } }	 na |  j |  \ } } } }
 } |
 | \ } } \ } } t | | | |  } t | | | |  }	 | | |	  } |  j d k	 r| |  j k rd d l m } | |  | |  j   n  | S(   s0   Computes quotient of fractions ``f`` and ``g``. i(   R   N(	   R   R   Ry  RL   Rz  R   R   R   R   (   R   R   R   R
   R   R~  R  R   Rn  Ro  R   R  R  R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   /  s    $c         C  s_   | r= |  j  d k	 r= |  j  j |   r= t |  |  j    n  |  j |  j |  j d t } | S(   s&   Computes inverse of a fraction ``f``. R"  N(   R   R   t   is_unitR   R   Ro  Rn  R   (   R   t   checkR   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR  C  s    (c         C  s   t  |  j |  j  S(   s.   Returns ``True`` if ``f`` is a zero fraction. (   R0   Rn  R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   J  s    c         C  s4   t  |  j |  j |  j  o3 t  |  j |  j |  j  S(   s.   Returns ``True`` if ``f`` is a unit fraction. (   R1   Rn  R   R
   Ro  (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRA  O  s    c         C  s
   |  j    S(   N(   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRN  U  s    c         C  s   t  | t t f  r" |  j |  Sy |  j |  j |   SWnr t k
 rP t St t f k
 r |  j	 d  k	 r y |  j |  j	 j |   SWq t t f k
 r q Xn  t SXd  S(   N(   R   R   Rm  R   R{  R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRQ  X  s    c         C  s   |  j  |  S(   N(   RQ  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRR  h  s    c         C  s   t  | t t f  r" |  j |  Sy |  j |  j |   SWnr t k
 rP t St t f k
 r |  j	 d  k	 r y |  j |  j	 j |   SWq t t f k
 r q Xn  t SXd  S(   N(   R   R   Rm  R   R{  R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRS  k  s    c         C  s   |  j  |  S(   N(   RQ  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRT  {  s    c         C  s   t  | t t f  r" |  j |  Sy |  j |  j |   SWnr t k
 rP t St t f k
 r |  j	 d  k	 r y |  j |  j	 j |   SWq t t f k
 r q Xn  t SXd  S(   N(   R   R   Rm  R   R{  R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRU  ~  s    c         C  s   |  j  |  S(   N(   RU  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRX    s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRY    s    c         C  s   t  | t t f  r" |  j |  Sy |  j |  j |   SWnr t k
 rP t St t f k
 r |  j	 d  k	 r y |  j |  j	 j |   SWq t t f k
 r q Xn  t SXd  S(   N(   R   R   Rm  R   R{  R   RO  R   RP  R   R   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRV    s    c         C  sZ   |  j  d t  | } |  j rV | |  j k rV d d l m } | | |  |  j   n  | S(   NR  i(   R   (   R  R   R   R   R   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRW    s
    c         C  s   y t  | t  rm |  j |  \ } } } \ } } } |  j | j k r t | |  j |  j  oi | | k Sn: |  j |  \ } } } } } |  j | j k r | | k SWn t k
 r n Xt S(   N(	   R   R   Ry  R   R1   R
   Rz  R   R   (   R   R   R   R~  R  R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR]    s    $%c         C  s   y t  | t  rn |  j |  \ } } } \ } } } |  j | j k r t | |  j |  j  oi | | k Sn: |  j |  \ } } } } } |  j | j k r | | k SWn t k
 r n Xt S(   N(	   R   R   Ry  R   R1   R
   Rz  R   R  (   R   R   R   R~  R  R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR^    s    $&c         C  s(   |  j  |  \ } } } } } | | k  S(   N(   Rz  (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRc    s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   Rz  (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRd    s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   Rz  (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRe    s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   Rz  (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRf    s    c         C  s   t  |  j |  j  S(   N(   R0   Rn  R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRg    s    N(5   R   R   R   Rh  R   R   R   Ru  Rq  R   R   Ry  Rz  R  R   R   R{  R   R   R|  R}  R"  R   R   R   R   R   R   R   R  Ri  R   RA  RN  RQ  RR  RS  RT  RU  RX  RY  RV  RW  Rj  Rk  R]  R^  Rc  Rd  Re  Rf  Rg  Rl  (    (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRm  ,  sd   
+			#	%																										c         C  s"   t  t |  |  t | |  |  S(   N(   t   ANPR   (   R   t   modR
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   init_normal_ANP  s    R  c           B  s  e  Z d  Z d d d g Z d   Z d   Z d   Z d   Z d0 d0 d  Z	 e
 d	    Z e
 d
    Z d   Z d   Z d   Z d   Z d   Z e
 d    Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e Z d   Z d   Z e d    Z e d    Z  e d    Z! d   Z" d   Z# d    Z$ d!   Z% d"   Z& d#   Z' d$   Z( d%   Z) d&   Z* d'   Z+ d(   Z, e, Z- d)   Z. d*   Z/ d+   Z0 d,   Z1 d-   Z2 d.   Z3 d/   Z4 e4 Z5 RS(1   s1   Dense Algebraic Number Polynomials over a field. R   R  R
   c         C  s   t  |  t k r' t | |  |  _ n6 t  |  t k	 rN | j |  g } n  t |  |  _ t | t  r{ | j |  _	 n6 t  |  t k r t | |  |  _	 n t |  |  _	 | |  _
 d  S(   N(   R   R   R3   R   R   R   R$   R   R   R  R
   (   R   R   R  R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s#   d |  j  j |  j |  j |  j f S(   Ns   %s(%s, %s, %s)(   R   R   R   R  R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s1   t  |  j j |  j   t |  j d  |  j f  S(   Ni    (   R   R   R   R   R>   R  R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c           s6  t  | t  s" |  j | j k r; t d |  | f   n  |  j | j k ro |  j |  j |  j | j |  j f S|  j j | j    t |  j |  j    } t | j | j    }   |  j k r   | j k r t |  j |  j     n$   |  j k r|  j  n	 | j     f d   }   | | |  f S(   s0   Unify representations of two algebraic numbers. s   can't unify %s with %sc           s   t  |      S(   N(   R  (   R   (   R
   R  (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   <lambda>  t    (	   R   R  R  R   R
   R   R   R   R!   (   R   R   R   R   R   (    (   R
   R  s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   	  s    ""	c         C  s"   t  | | p |  j | p |  j  S(   N(   R  R  R
   (   R   R   R  R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   "  s    c         C  s   t  d | |  S(   Ni    (   R  (   R   R  R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   %  s    c         C  s   t  d | |  S(   Ni   (   R  (   R   R  R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   )  s    c         C  s   t  |  j d |  j  S(   sA   Convert ``f`` to a dict representation with native coefficients. i    (   R5   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   -  s    c         C  sO   t  |  j d |  j  } x0 | j   D]" \ } } |  j j |  | | <q% W| S(   s@   Convert ``f`` to a dict representation with SymPy coefficients. i    (   R5   R   R
   R   R   (   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   1  s    c         C  s   |  j  S(   sA   Convert ``f`` to a list representation with native coefficients. (   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   :  s    c         C  s&   g  |  j  D] } |  j j |  ^ q
 S(   s@   Convert ``f`` to a list representation with SymPy coefficients. (   R   R
   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   >  s    c         C  s   t  |  j d  S(   sx   
        Convert ``f`` to a tuple representation with native coefficients.

        This is needed for hashing.
        i    (   R>   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   B  s    c         C  s(   t  t t t | j |    | |  S(   N(   R  R$   R   R  R   (   R   R   R  R
   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   J  s    c         C  s   |  j  t |  j |  j   S(   N(   R   RE   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   N  s    c         C  s4   |  j  |  \ } } } } } | t | | |   S(   N(   R   RG   (   R   R   R
   R   R   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   Q  s    c         C  s4   |  j  |  \ } } } } } | t | | |   S(   N(   R   RI   (   R   R   R
   R   R   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   U  s    c         C  s@   |  j  |  \ } } } } } | t t | | |  | |   S(   N(   R   RU   RK   (   R   R   R
   R   R   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   Y  s    c         C  s   t  | t  rx | d k  rA t |  j |  j |  j  | } } n	 |  j } |  j t t | | |  j  |  j |  j   St	 d t
 |    d S(   s+   Raise ``f`` to a non-negative power ``n``. i    s   ``int`` expected, got %sN(   R   R   Rm   R   R  R
   R   RU   RN   R   R   (   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   ]  s    &	.c         C  s^   |  j  |  \ } } } } } | t t | t | | |  |  | |   |  j | |  f S(   N(   R   RU   RK   Rm   R   (   R   R   R
   R   R   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   i  s    c         C  sh   |  j  |  \ } } } } } t | | |  \ } } | | j g k rX |  j | |  St d   d  S(   Ns   zero divisor(   R   Rk   R   R   R   (   R   R   R
   R   R   R  R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   m  s
    c         C  sL   |  j  |  \ } } } } } | t t | t | | |  |  | |   S(   N(   R   RU   RK   Rm   (   R   R   R
   R   R   R   R  (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR   w  s    c         C  s   t  |  j |  j  S(   s*   Returns the leading coefficient of ``f``. (   R)   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR  }  s    c         C  s   t  |  j |  j  S(   s+   Returns the trailing coefficient of ``f``. (   R+   R   R
   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR    s    c         C  s   |  S(   s6   Returns ``True`` if ``f`` is a zero algebraic number. (    (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR     s    c         C  s   |  j  |  j j g k S(   s6   Returns ``True`` if ``f`` is a unit algebraic number. (   R   R
   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRA    s    c         C  s   |  j  p t |  j   d k S(   s>   Returns ``True`` if ``f`` is an element of the ground domain. i   (   R   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRB    s    c         C  s
   |  j    S(   N(   R   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRN    s    c         C  sU   t  | t  r |  j |  Sy |  j |  j |   SWn t t f k
 rP t SXd  S(   N(   R   R  R   R   R   R   RO  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRQ    s    c         C  s   |  j  |  S(   N(   RQ  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRR    s    c         C  sU   t  | t  r |  j |  Sy |  j |  j |   SWn t t f k
 rP t SXd  S(   N(   R   R  R   R   R   R   RO  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRS    s    c         C  s   |  j  |  S(   N(   RQ  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRT    s    c         C  sU   t  | t  r |  j |  Sy |  j |  j |   SWn t t f k
 rP t SXd  S(   N(   R   R  R   R   R   R   RO  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRU    s    c         C  s   |  j  |  S(   N(   RU  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRX    s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRY    s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRZ    s    c         C  s   |  j  |  S(   N(   R   (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR[    s    c         C  sU   t  | t  r |  j |  Sy |  j |  j |   SWn t t f k
 rP t SXd  S(   N(   R   R  R   R   R   R   RO  (   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRV    s    c         C  sE   y, |  j  |  \ } } } } } | | k SWn t k
 r@ t SXd  S(   N(   R   R   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR]    s
    c         C  sE   y, |  j  |  \ } } } } } | | k SWn t k
 r@ t SXd  S(   N(   R   R   R  (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR^    s
    c         C  s(   |  j  |  \ } } } } } | | k  S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRc    s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRd    s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRe    s    c         C  s(   |  j  |  \ } } } } } | | k S(   N(   R   (   R   R   R   R   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRf    s    c         C  s   t  |  j  S(   N(   t   boolR   (   R   (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyRg    s    N(6   R   R   R   Rh  R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  Ri  R   RA  RB  RN  RQ  RR  RS  RT  RU  RX  RY  RZ  R[  RV  Rj  R]  R^  Rc  Rd  Re  Rf  Rg  Rl  (    (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyR    sb   																	
																									N(   R   t
   __future__R    R   t   sympyR   t   sympy.core.sympifyR   R   R   R   R   t   sympy.polys.polyutilsR   R   t   sympy.polys.densebasicR   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   R+   R,   R-   R.   R/   R0   R1   R2   R3   R4   R5   R6   R7   R8   R9   R:   R;   R<   R=   R>   t   sympy.polys.densearithR?   R@   RA   RB   RC   RD   RE   RF   RG   RH   RI   RJ   RK   RL   RM   RN   RO   RP   RQ   RR   RS   RT   RU   RV   RW   RX   RY   RZ   R[   R\   t   sympy.polys.densetoolsR]   R^   R_   R`   Ra   Rb   Rc   Rd   Re   Rf   Rg   Rh   Ri   Rj   t   sympy.polys.euclidtoolsRk   Rl   Rm   Rn   Ro   Rp   Rq   Rr   Rs   Rt   t   sympy.polys.sqfreetoolsRu   Rv   Rw   Rx   Ry   Rz   R{   t   sympy.polys.factortoolsR|   R}   R~   R   t   sympy.polys.rootisolationR   R   R   R   R   R   R   R   R   R   R   R   Rp  Rm  R  R  (    (    (    s6   lib/python2.7/site-packages/sympy/polys/polyclasses.pyt   <module>   s0   ^F
4":
	   	 	