ó
’¼÷Xc           @` s“   d  Z  d d l m Z m Z m Z d d l Z d d l j j	 Z
 d d l m Z m Z m Z m Z m Z m Z d e f d     YZ d e f d     YZ e d	 k r° e   n  d S(
   s   Tests for polyutils module.

i    (   t   divisiont   absolute_importt   print_functionN(   t   TestCaset   assert_almost_equalt   assert_raisest   assert_equalt   assert_t   run_module_suitet   TestMiscc           B` s#   e  Z d    Z d   Z d   Z RS(   c         C` sN   xG t  d  D]9 } d g } t j d g d g d  } t | |  q Wd  S(   Ni   i   i    (   t   ranget   put   trimseqR   (   t   selft   it   tgtt   res(    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   test_trimseq   s    	c         C` s  t  t t j g  g  t  t t j d d g g g  t  t t j d g d g g  d d d g } x® t t |   D] } x t |  D] } t j d | |  } t j d | |  } t j | | g  \ } } t | j	 j
 | j	 j
 k  t | j	 j
 | | k  q Wqv Wd  S(   Ni   i   t   aR   t   dt   O(   R   t
   ValueErrorR   t	   as_seriesR
   t   lent   npt   onesR   t   dtypet   char(   R   t   typesR   t   jt   cit   cjt   resit   resj(    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   test_as_series   s    c         C` s   d d d d g } t  t t j | d  t t j |  | d   t t j | d  | d   t t j | d  d g  d  S(   Ni   i’’’’i   i    iż’’’(   R   R   R   t   trimcoefR   (   R   t   coef(    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   test_trimcoef$   s
    (   t   __name__t
   __module__R   R"   R%   (    (    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyR	      s   		t
   TestDomainc           B` s#   e  Z d    Z d   Z d   Z RS(   c         C` sx   d d d d g } d d g } t  j |  } t | |  d	 d
 d d g } d d g } t  j |  } t | |  d  S(   Ni   i
   i   i’’’’y              š?i    i   y              šæy      š?      š?y      š?      šæy       @      š?(   R   t	   getdomainR   (   R   t   xR   R   (    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   test_getdomain0   s    c         C` sF  d d g } d d g } | } t  j | | |  } t | |  d d	 g } d d g } | } | } t  j | | |  } t | |  d d g } d d g } t j | | g  } t j | | g  } t  j | | |  } t | |  d d g } d d g } t j | | g  } t  j | | |  } t t | t j   d  S(
   Ni    i   i   i   y              š?i   iž’’’y              šæy       @      š?(   R   t	   mapdomainR   R   t   arrayt   matrixR   t
   isinstance(   R   t   dom1t   dom2R   R   R*   (    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   test_mapdomain=   s,    c         C` s   d d g } d d g } d d g } t  j | |  } t | |  d
 d g } d d g } d d g } t  j | |  } t | |  d  S(   Ni    i   i   i   g      ą?y              š?i   iž’’’i’’’’y              šæy       @      š?y      šæ      š?y      š?      šæ(   R   t   mapparmsR   (   R   R0   R1   R   R   (    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   test_mapparms\   s    (   R&   R'   R+   R2   R4   (    (    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyR(   .   s   		t   __main__(   t   __doc__t
   __future__R    R   R   t   numpyR   t   numpy.polynomial.polyutilst
   polynomialt	   polyutilsR   t   numpy.testingR   R   R   R   R   R   R	   R(   R&   (    (    (    sD   /tmp/pip-build-2Vcwy8/numpy/numpy/polynomial/tests/test_polyutils.pyt   <module>   s   .!>