ó
~9­\c           @   sÚ   d  d l  m Z d  d l m Z d  d l m Z m Z d  d l m Z m	 Z	 e d  \ Z
 Z Z e d e
 e
  Z e d e
 e  Z e d e
 e  Z e d	 e e  Z d
   Z d   Z d   Z d   Z d   Z d S(   i˙˙˙˙(   t   symbols(   t   raises(   t
   ShapeErrort   MatrixSymbol(   t   HadamardProductt   hadamard_products   n,m,kt   Zt   At   Bt   Cc          C   s  t  t t t  j t j k s$ t  t t d    t t d    t t d    t  t d t t  d d t d t d	 t d
 k s t  t  t t t  t	 }  |  j t
 t f k sĹ t  t t  t t t  j j  t t j t j t j f  k st  d  S(   Nc           S   s   t  t t j  S(   N(   R   R   R   t   T(    (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt   <lambda>   t    c           S   s   t  t t  S(   N(   R   R   t   n(    (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyR      R   c           S   s   t  t d  S(   Ni   (   R   R   (    (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyR      R   i   i   iţ˙˙˙(   i   i   (   i   i   (   i   i   (   i   i   (   R   R   R   t   shapet   AssertionErrorR   R   t	   TypeErrorR   R	   R   t   kt   setR
   t   args(   t   mix(    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt   test_HadamardProduct   s    $'c           C   s(   t  t t  t  t t  k s$ t  d  S(   N(   R   R   R   R   (    (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt%   test_HadamardProduct_isnt_commutative   s    c          C   s   t  d d d  }  t  d d d  } t  d d d  } |  t | |  d |  d | d	 | d
 |  d | d | d k s t  d  S(   Nt   Xi   t   YR   i    i   (   i    i    (   i    i    (   i    i    (   i    i    (   i    i   (   i   i    (   i   i    (   R   R   R   (   R   R   R   (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt   test_mixed_indexing   s
    c          C   s^   t  d d d  }  t |  d t } t | t  s9 t  | j   } t | t   sZ t  d  S(   NR   i   t   check(   R   R   t   Falset
   isinstanceR   t   doit(   R   t   exprt   expr2(    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt   test_canonicalize'   s
    c          C   sď   t  d d t \ }  } } t d |  |  } t d |  |  } t d |  |  } t t   t   Wd  QXt |  | k s t  t t | |  t  sĄ t  t | |  j	   t | |  k sË t  t t
   t | |  Wd  QXd  S(   Ns   m, n, pt   integerR   R   R	   (   R    t   TrueR   R   R   R   R   R   R   R   R   (   t   mR   t   pR   R   R	   (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt   test_hadamard.   s    *N(   t
   sympy.coreR    t   sympy.utilities.pytestR   t   sympy.matricesR   R   t   sympy.matrices.expressionsR   R   R   R#   R   R   R   R   R	   R   R   R   R    R%   (    (    (    sM   lib/python2.7/site-packages/sympy/matrices/expressions/tests/test_hadamard.pyt   <module>   s   				