
ʽXc           @` s   d  d l  m Z m Z m Z d  d l Z d  d l m Z m Z m	 Z	 m
 Z
 m Z m Z d  d l m Z d e f d     YZ e d k r e   n  d S(   i    (   t   absolute_importt   divisiont   print_functionN(   t   TestCaset   run_module_suitet   assert_allcloset   assert_equalt   assert_almost_equalt   assert_raises(   t
   procrustest   ProcrustesTestsc           B` sG   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C` s  t  j d d g d d g d d g d d g g d  |  _ t  j d d g d d g d d g d d g g d  |  _ t  j d d g d d g d d g d d	 g g d  |  _ t  j d
 } t  j d d g d d g d d g d d g g d  t  j d  |  _ t  j t  j |  t  j	 |  g t  j t  j d |  t  j	 t  j d |  g t  j |  t  j	 |  g t  j t  j d |  t  j	 t  j d |  g g d  t  j d  |  _
 d S(   s   creates inputsi   i   i   t   di   iiig      @i   i    iN(   t   npt   arrayt   data1t   data2t   data3t   pit   sqrtt   data4t   cost   sint   data5(   t   selft
   shiftangle(    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt   setUp   s    999!%!c   
      C` s   t  |  j |  j  \ } } } t | |  t | d  t  |  j |  j  \ } } } t | |  j  t  |  j |  j  \ } } }	 d  S(   Ng        (	   R	   R   R   R   R   R   R   R   R   (
   R   t   at   bt	   disparityt   m4t   m5t   disp45t   m1t   m3t   disp13(    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt   test_procrustes'   s    c         C` sh  t  |  j |  j  \ } } } t  |  j |  j  \ } } } t | |  t j d d d g d d d g d d d	 g d
 d d g d d d g d d d g d d d g d d d g g  } t j d d d g d d d g d d  d! g d" d# d$ g d% d& d' g d( d) d* g d+ d, d- g d. d/ d0 g g  } t  | |  \ }	 }
 } t  | |  \ } } } t | |  d  S(1   Ngߐ@gĈ?gYA?gR;EQ?gzOg/߸cԿgwKi?gc3O?g٣ÿg) A	 @gJ?g:o?gً3?gvO\?g<Р?g}v#?gP#@g-@gN	g;?go{1?gg=?gW$g*?gDW?gUϓ|6?g|_;?g\X3ƿg8g[g7~gVD?s?g$SgB9?gd?gq6ɿglx?g#)w<?gyw<5?g;{?gxi7?g9JNgv[SjgYNggj$#g^pտgDЍg6t(\ҿg1K[?(   R	   R   R   R   R   R   (   R   R    R!   R"   t   m3_2t   m1_2t   disp31t   rand1t   rand3t   res1t   res3t   res3_2t   res1_2(    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt   test_procrustes2:   s,    c      	   C` sS   t  t t t j d d g d d g g  t j d d d g d d	 d
 g g   d  S(   Ni   i   i   i   i   i   i   i   i	   i
   (   R   t
   ValueErrorR	   R   R   (   R   (    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt   test_procrustes_shape_mismatchV   s    	c         C` s)   t  j g  g  } t t t | |  d  S(   N(   R   R   R   R.   R	   (   R   t   empty(    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt"   test_procrustes_empty_rows_or_cols[   s    c         C` sM   t  t t t j d d g d d g g  t j d d g d d g g   d  S(   Ni*   i-   (   R   R.   R	   R   R   (   R   (    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt   test_procrustes_no_variation_   s    	c         C` s   t  t t t j d d d d d d g  t j d d g d d g g   t  t t t j d d d d d d g  t j d d d d d d g   t  t t t j d  t j d   t  t t t j d g d g g g  t j d d	 g g g   d  S(
   Ni   i   i   i   i   i   i   i   i   (   R   R.   R	   R   R   (   R   (    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt(   test_procrustes_bad_number_of_dimensionsd   s    	"	"%	(	   t   __name__t
   __module__R   R#   R-   R/   R1   R2   R3   (    (    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyR
   
   s   						t   __main__(   t
   __future__R    R   R   t   numpyR   t   numpy.testingR   R   R   R   R   R   t   scipy.spatialR	   R
   R4   (    (    (    sC   /tmp/pip-build-7oUkmx/scipy/scipy/spatial/tests/test__procrustes.pyt   <module>   s   .n