
~9\c           @   s:   d  d l  m Z d  d l m Z d e f d     YZ d S(   i(   t
   MatrixExpr(   t
   MatrixBaset   ElementwiseApplyFunctionc           B   sM   e  Z d  Z d   Z e d    Z e d    Z e d    Z d   Z RS(   s	  
    Apply function to a matrix elementwise without evaluating.

    Examples
    ========

    >>> from sympy.matrices.expressions import MatrixSymbol
    >>> from sympy.matrices.expressions.applyfunc import ElementwiseApplyFunction
    >>> from sympy import exp
    >>> X = MatrixSymbol("X", 3, 3)
    >>> X.applyfunc(exp)
    ElementwiseApplyFunction(exp, X)

    >>> from sympy import eye
    >>> expr = ElementwiseApplyFunction(exp, eye(3))
    >>> expr
    ElementwiseApplyFunction(exp, Matrix([
    [1, 0, 0],
    [0, 1, 0],
    [0, 0, 1]]))
    >>> expr.doit()
    Matrix([
    [E, 1, 1],
    [1, E, 1],
    [1, 1, E]])

    Notice the difference with the real mathematical functions:

    >>> exp(eye(3))
    Matrix([
    [E, 0, 0],
    [0, E, 0],
    [0, 0, E]])
    c         C   s+   t  j |  | |  } | | _ | | _ | S(   N(   R    t   __new__t	   _functiont   _expr(   t   clst   functiont   exprt   obj(    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyR   )   s    		c         C   s   |  j  S(   N(   R   (   t   self(    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyR   /   s    c         C   s   |  j  S(   N(   R   (   R
   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyR   3   s    c         C   s
   |  j  j S(   N(   R   t   shape(   R
   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyR   7   s    c         K   sZ   | j  d t  } |  j } | r3 | j |   } n  t | t  rR | j |  j  S|  Sd  S(   Nt   deep(   t   gett   TrueR   t   doitt
   isinstanceR   t	   applyfuncR   (   R
   t   kwargsR   R   (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyR   ;   s    	(	   t   __name__t
   __module__t   __doc__R   t   propertyR   R   R   R   (    (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyR      s   "	N(   t   sympy.matrices.expressionsR    t   sympyR   R   (    (    (    sC   lib/python2.7/site-packages/sympy/matrices/expressions/applyfunc.pyt   <module>   s   