ó
Ąź\c           @  s¤   d  d l  m Z m Z d  d l m Z m Z m Z m Z d d l m	 Z	 d e f d     YZ
 d   Z d  d l m Z m Z d  d	 l m Z d
   Z e e d <d S(   i˙˙˙˙(   t   print_functiont   division(   t   Basict   Exprt   St   sympifyi   (   t
   ShapeErrort   Determinantc           B  s2   e  Z d  Z d   Z e d    Z e d  Z RS(   s  Matrix Determinant

    Represents the determinant of a matrix expression.

    Examples
    ========

    >>> from sympy import MatrixSymbol, Determinant, eye
    >>> A = MatrixSymbol('A', 3, 3)
    >>> Determinant(A)
    Determinant(A)
    >>> Determinant(eye(3)).doit()
    1
    c         C  sV   t  |  } | j s. t d t |    n  | j sF t d   n  t j |  |  S(   Ns&   Input to Determinant, %s, not a matrixs   Det of a non-square matrix(   R   t	   is_Matrixt	   TypeErrort   strt	   is_squareR   R   t   __new__(   t   clst   mat(    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyR      s    		c         C  s   |  j  d S(   Ni    (   t   args(   t   self(    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyt   arg!   s    c         C  s0   y |  j  j   SWn t t f k
 r+ |  SXd  S(   N(   R   t   _eval_determinantt   AttributeErrort   NotImplementedError(   R   t   expand(    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyt   doit%   s    (   t   __name__t
   __module__t   __doc__R   t   propertyR   t   FalseR   (    (    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyR      s   	
c         C  s   t  |   j   S(   sĹ    Matrix Determinant

    Examples
    ========

    >>> from sympy import MatrixSymbol, det, eye
    >>> A = MatrixSymbol('A', 3, 3)
    >>> det(A)
    Determinant(A)
    >>> det(eye(3))
    1
    (   R   R   (   t   matexpr(    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyt   det+   s    (   t   askt   Q(   t   handlers_dictc         C  sj   t  t j |  j  |  r" t j St  t j |  j  |  rD t j St  t j |  j  |  rf t j S|  S(   sÜ   
    >>> from sympy import MatrixSymbol, Q, assuming, refine, det
    >>> X = MatrixSymbol('X', 2, 2)
    >>> det(X)
    Determinant(X)
    >>> with assuming(Q.orthogonal(X)):
    ...     print(refine(det(X)))
    1
    (	   R   R   t
   orthogonalR   R   t   Onet   singulart   Zerot   unit_triangular(   t   exprt   assumptions(    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyt   refine_Determinant@   s    
N(   t
   __future__R    R   t   sympyR   R   R   R   R   R   R   R   t   sympy.assumptions.askR   R   t   sympy.assumptions.refineR    R(   (    (    (    sE   lib/python2.7/site-packages/sympy/matrices/expressions/determinant.pyt   <module>   s   "$		