ó
£áSc           @` s¯  d  d l  m Z m Z m Z d d d d g Z d  d l Z d  d l j j Z	 d  d l m
 Z
 m Z m Z m Z m Z d  d l m Z d	 Z e j d  d
 k rÅ d f  d „  ƒ  YZ e ƒ  Z d „  Z n‘ e g d Z x$ e d ƒ D] Z e e ƒ e e <qß Wd j e ƒ Z g  Z x* e D]" Z e e k r7e j e ƒ n  qWd j e ƒ Z [ d „  Z d „  Z e d „ Z d „  Z d e	 j  f d „  ƒ  YZ! d „  Z" e e d „ Z# e Z$ d S(   i    (   t   divisiont   absolute_importt   print_functiont   matrixt   bmatt   matt   asmatrixN(   t   concatenatet   isscalart   binary_reprt   identityt
   asanyarray(   t
   issubdtypes   0123456789.-+jeELi   t   _NumCharTablec           B` s   e  Z d  „  Z RS(   c         C` s$   t  | ƒ t k r t  | ƒ Sd  Sd  S(   N(   t   chrt	   _numcharst   None(   t   selft   i(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __getitem__   s    
(   t   __name__t
   __module__R   (    (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR      s   c         C` s6   |  j  t ƒ } | s( t d |  ƒ ‚ n
 t | ƒ Sd  S(   Ns   Invalid data string supplied: (   t	   translatet   _tablet	   TypeErrort   eval(   t   astrt   str_(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   _eval   s    i   t    c         C` s9   |  j  t t ƒ } | s+ t d |  ƒ ‚ n
 t | ƒ Sd  S(   Ns   Invalid data string supplied: (   R   R   t	   _todeleteR   R   (   R   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR   )   s    c   
      C` sË   |  j  d ƒ } g  } d } x© | D]¡ } | j  d ƒ } g  } x0 | D]( } | j  ƒ  } | j t t | ƒ ƒ qD W| d k r‹ t | ƒ }	 n! t | ƒ |	 k r¬ t d ƒ ‚ n  | d 7} | j | ƒ q" W| S(   Nt   ;i    t   ,s   Rows not the same size.i   (   t   splitt   extendt   mapR   t   lent
   ValueErrort   append(
   t   datat   rowst   newdatat   countt   rowt   trowt   newrowt   colt   tempt   Ncols(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   _convert_from_string0   s     
c         C` s   t  |  d | d t ƒS(   s  
    Interpret the input as a matrix.

    Unlike `matrix`, `asmatrix` does not make a copy if the input is already
    a matrix or an ndarray.  Equivalent to ``matrix(data, copy=False)``.

    Parameters
    ----------
    data : array_like
        Input data.

    Returns
    -------
    mat : matrix
        `data` interpreted as a matrix.

    Examples
    --------
    >>> x = np.array([[1, 2], [3, 4]])

    >>> m = np.asmatrix(x)

    >>> x[0,0] = 5

    >>> m
    matrix([[5, 2],
            [3, 4]])

    t   dtypet   copy(   R   t   False(   R'   R2   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR   B   s    c   
      C` sÞ  t  |  ƒ }  t |  j ƒ d k s; |  j d |  j d k rJ t d ƒ ‚ n  t t | ƒ t ƒ sn t d ƒ ‚ n  d d l m	 } | d k r® |  j
 ƒ  }  t |  j d ƒ |  (|  S| d k  rÓ | |  ƒ }  | d 9} n  |  } | d k rx* t | d ƒ D] } t j | |  ƒ } qö W| St | ƒ } |  d t | ƒ } } } x8 | | | d d	 k rvt j | | ƒ } | d 7} q?W| } xZ t | d | ƒ D]E }	 t j | | ƒ } | | |	 d d
 k r‘t j | | ƒ } q‘q‘W| S(   s{  
    Raise a square matrix to the (integer) power `n`.

    For positive integers `n`, the power is computed by repeated matrix
    squarings and matrix multiplications. If ``n == 0``, the identity matrix
    of the same shape as M is returned. If ``n < 0``, the inverse
    is computed and then raised to the ``abs(n)``.

    Parameters
    ----------
    M : ndarray or matrix object
        Matrix to be "powered."  Must be square, i.e. ``M.shape == (m, m)``,
        with `m` a positive integer.
    n : int
        The exponent can be any integer or long integer, positive,
        negative, or zero.

    Returns
    -------
    M**n : ndarray or matrix object
        The return value is the same shape and type as `M`;
        if the exponent is positive or zero then the type of the
        elements is the same as those of `M`. If the exponent is
        negative the elements are floating-point.

    Raises
    ------
    LinAlgError
        If the matrix is not numerically invertible.

    See Also
    --------
    matrix
        Provides an equivalent function as the exponentiation operator
        (``**``, not ``^``).

    Examples
    --------
    >>> from numpy import linalg as LA
    >>> i = np.array([[0, 1], [-1, 0]]) # matrix equiv. of the imaginary unit
    >>> LA.matrix_power(i, 3) # should = -i
    array([[ 0, -1],
           [ 1,  0]])
    >>> LA.matrix_power(np.matrix(i), 3) # matrix arg returns matrix
    matrix([[ 0, -1],
            [ 1,  0]])
    >>> LA.matrix_power(i, 0)
    array([[1, 0],
           [0, 1]])
    >>> LA.matrix_power(i, -3) # should = 1/(-i) = i, but w/ f.p. elements
    array([[ 0.,  1.],
           [-1.,  0.]])

    Somewhat more sophisticated example

    >>> q = np.zeros((4, 4))
    >>> q[0:2, 0:2] = -i
    >>> q[2:4, 2:4] = i
    >>> q # one of the three quarternion units not equal to 1
    array([[ 0., -1.,  0.,  0.],
           [ 1.,  0.,  0.,  0.],
           [ 0.,  0.,  0.,  1.],
           [ 0.,  0., -1.,  0.]])
    >>> LA.matrix_power(q, 2) # = -np.eye(4)
    array([[-1.,  0.,  0.,  0.],
           [ 0., -1.,  0.,  0.],
           [ 0.,  0., -1.,  0.],
           [ 0.,  0.,  0., -1.]])

    i   i    i   s   input must be a square arrays   exponent must be an integer(   t   inviÿÿÿÿi   t   0t   1(   R   R$   t   shapeR%   R   t   typet   intR   t   numpy.linalgR5   R3   R
   t   ranget   Nt   dotR	   (
   t   Mt   nR5   t   resultt   _t   betat   Zt   qt   tt   k(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   matrix_powerb   s:    G/c           B` s÷  e  Z d  Z d Z d( e d „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d( d( d( d „ Z d( d( d( d „ Z d( d( d( d d „ Z d( d( d( d d „ Z d( d( d( d „ Z d( d( d „ Z d( d( d „ Z d( d( d „ Z d( d( d „ Z d( d( d „ Z d( d( d „ Z d( d( d „ Z d „  Z  d „  Z! d „  Z" d  „  Z# d! „  Z$ e% e# d( d" d# ƒZ& e% e! d( d" d$ ƒZ' e% e" d( d" d% ƒZ( e% e$ d( d" d& ƒZ) e% e  d( d" d' ƒZ* RS()   sË  
    matrix(data, dtype=None, copy=True)

    Returns a matrix from an array-like object, or from a string of data.
    A matrix is a specialized 2-D array that retains its 2-D nature
    through operations.  It has certain special operators, such as ``*``
    (matrix multiplication) and ``**`` (matrix power).

    Parameters
    ----------
    data : array_like or string
       If `data` is a string, it is interpreted as a matrix with commas
       or spaces separating columns, and semicolons separating rows.
    dtype : data-type
       Data-type of the output matrix.
    copy : bool
       If `data` is already an `ndarray`, then this flag determines
       whether the data is copied (the default), or whether a view is
       constructed.

    See Also
    --------
    array

    Examples
    --------
    >>> a = np.matrix('1 2; 3 4')
    >>> print a
    [[1 2]
     [3 4]]

    >>> np.matrix([[1, 2], [3, 4]])
    matrix([[1, 2],
            [3, 4]])

    g      $@c         C` sÙ  t  | t ƒ rQ | j } | d  k r- | } n  | | k rD | rD | S| j | ƒ St  | t j ƒ rÌ | d  k r{ | j } n t j | ƒ } | j |  ƒ } | | j k rµ | j | ƒ S| rÅ | j ƒ  S| Sn  t  | t	 ƒ rê t
 | ƒ } n  t j | d | d | ƒ} | j } | j }	 | d k r2t d ƒ ‚ n4 | d k rGd	 }	 n | d k rfd |	 d f }	 n  t }
 | d k r�| j j r�t }
 n  |
 pœ| j j s®| j ƒ  } n  t j j |  |	 | j d | d |
 ƒ} | S(
   NR2   R3   i   s   matrix must be 2-dimensionali    i   t   buffert   order(   i   i   (   t
   isinstanceR   R2   R   t   astypeR=   t   ndarrayt   viewR3   t   strR1   t   arrayt   ndimR8   R%   R4   t   flagst   fortrant   Truet
   contiguoust   __new__(   t   subtypeR'   R2   R3   t   dtype2t   intypet   newt   arrRQ   R8   RJ   t   ret(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyRV   ô   sJ    		 
					c         C` s  t  |  _ t | t ƒ r% | j r% d  S|  j } | d k r> d  S| d k r» t g  |  j D] } | d k rW | ^ qW ƒ } t | ƒ } | d k r� | |  _ d  S| d k rÄ t d ƒ ‚ qÄ n	 |  j } | d k rÜ d |  _ n" | d k rþ d | d f |  _ n  d  S(   Ni   i   s   shape too large to be a matrix.i    (   i   i   (	   R4   t   _getitemRK   R   RQ   t   tupleR8   R$   R%   (   R   t   objRQ   t   xt   newshape(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __array_finalize__"  s(    	 	.		c         C` sÜ   t  |  _ z t j j |  | ƒ } Wd  t |  _ Xt | t j ƒ sE | S| j d k r\ | d S| j d k rØ | j d } y t	 | ƒ } Wn d } n X| d k rÆ t
 | d ƒ rÆ | d f | _ qØ d | f | _ n  | S(   Ni    i   (    (   RT   R]   R=   RM   R   R4   RK   RQ   R8   R$   R   (   R   t   indext   outt   shR@   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR   8  s$    	

c         C` sa   t  | t j t t f ƒ r1 t j |  t | ƒ ƒ St | ƒ sM t | d ƒ r] t j |  | ƒ St	 S(   Nt   __rmul__(
   RK   R=   RM   t   listR^   R>   R   R   t   hasattrt   NotImplemented(   R   t   other(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __mul__R  s
    c         C` s   t  j | |  ƒ S(   N(   R=   R>   (   R   Rj   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyRf   Z  s    c         C` s   |  | |  (|  S(   N(    (   R   Rj   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __imul__]  s    c         C` s   t  |  | ƒ S(   N(   RH   (   R   Rj   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __pow__a  s    c         C` s   |  | |  (|  S(   N(    (   R   Rj   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __ipow__d  s    c         C` s   t  S(   N(   Ri   (   R   Rj   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __rpow__h  s    c         C` sv   t  |  j ƒ  ƒ j d d ƒ } | j ƒ  } x< t d t | ƒ ƒ D]% } | | r@ d | | | | <q@ q@ Wd j | ƒ S(   NRP   R   i   t    s   
(   t   reprt	   __array__t   replacet
   splitlinesR<   R$   t   join(   R   t   st   lR   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __repr__k  s    
c         C` s   t  |  j ƒ  ƒ S(   N(   RO   Rr   (   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   __str__u  s    c         C` sJ   | d k r |  d S| d k r$ |  S| d k r: |  j ƒ  St d ƒ ‚ d S(   s^   A convenience function for operations that need to preserve axis
        orientation.
        i    i   s   unsupported axisN(   i    i    (   R   t	   transposeR%   (   R   t   axis(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   _alignx  s    
c         C` s   | d k r |  d S|  Sd S(   s�   A convenience function for operations that want to collapse
        to a scalar like _align, but are using keepdims=True
        i    N(   i    i    (   R   (   R   R{   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt	   _collapse…  s    c         C` s   |  j  ƒ  j ƒ  S(   sÂ  
        Return the matrix as a (possibly nested) list.

        See `ndarray.tolist` for full documentation.

        See Also
        --------
        ndarray.tolist

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.tolist()
        [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]]

        (   Rr   t   tolist(   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR~   �  s    c         C` s(   t  j j |  | | | d t ƒj | ƒ S(   s  
        Returns the sum of the matrix elements, along the given axis.

        Refer to `numpy.sum` for full documentation.

        See Also
        --------
        numpy.sum

        Notes
        -----
        This is the same as `ndarray.sum`, except that where an `ndarray` would
        be returned, a `matrix` object is returned instead.

        Examples
        --------
        >>> x = np.matrix([[1, 2], [4, 3]])
        >>> x.sum()
        10
        >>> x.sum(axis=1)
        matrix([[3],
                [7]])
        >>> x.sum(axis=1, dtype='float')
        matrix([[ 3.],
                [ 7.]])
        >>> out = np.zeros((1, 2), dtype='float')
        >>> x.sum(axis=1, dtype='float', out=out)
        matrix([[ 3.],
                [ 7.]])

        t   keepdims(   R=   RM   t   sumRT   R}   (   R   R{   R2   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR€   §  s     c         C` s(   t  j j |  | | | d t ƒj | ƒ S(   sà  
        Returns the average of the matrix elements along the given axis.

        Refer to `numpy.mean` for full documentation.

        See Also
        --------
        numpy.mean

        Notes
        -----
        Same as `ndarray.mean` except that, where that returns an `ndarray`,
        this returns a `matrix` object.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3, 4)))
        >>> x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.mean()
        5.5
        >>> x.mean(0)
        matrix([[ 4.,  5.,  6.,  7.]])
        >>> x.mean(1)
        matrix([[ 1.5],
                [ 5.5],
                [ 9.5]])

        R   (   R=   RM   t   meanRT   R}   (   R   R{   R2   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR�   É  s     i    c         C` s+   t  j j |  | | | | d t ƒj | ƒ S(   s?  
        Return the standard deviation of the array elements along the given axis.

        Refer to `numpy.std` for full documentation.

        See Also
        --------
        numpy.std

        Notes
        -----
        This is the same as `ndarray.std`, except that where an `ndarray` would
        be returned, a `matrix` object is returned instead.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3, 4)))
        >>> x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.std()
        3.4520525295346629
        >>> x.std(0)
        matrix([[ 3.26598632,  3.26598632,  3.26598632,  3.26598632]])
        >>> x.std(1)
        matrix([[ 1.11803399],
                [ 1.11803399],
                [ 1.11803399]])

        R   (   R=   RM   t   stdRT   R}   (   R   R{   R2   Rd   t   ddof(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR‚   ë  s     c         C` s+   t  j j |  | | | | d t ƒj | ƒ S(   s*  
        Returns the variance of the matrix elements, along the given axis.

        Refer to `numpy.var` for full documentation.

        See Also
        --------
        numpy.var

        Notes
        -----
        This is the same as `ndarray.var`, except that where an `ndarray` would
        be returned, a `matrix` object is returned instead.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3, 4)))
        >>> x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.var()
        11.916666666666666
        >>> x.var(0)
        matrix([[ 10.66666667,  10.66666667,  10.66666667,  10.66666667]])
        >>> x.var(1)
        matrix([[ 1.25],
                [ 1.25],
                [ 1.25]])

        R   (   R=   RM   t   varRT   R}   (   R   R{   R2   Rd   Rƒ   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR„     s     c         C` s(   t  j j |  | | | d t ƒj | ƒ S(   sÕ  
        Return the product of the array elements over the given axis.

        Refer to `prod` for full documentation.

        See Also
        --------
        prod, ndarray.prod

        Notes
        -----
        Same as `ndarray.prod`, except, where that returns an `ndarray`, this
        returns a `matrix` object instead.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.prod()
        0
        >>> x.prod(0)
        matrix([[  0,  45, 120, 231]])
        >>> x.prod(1)
        matrix([[   0],
                [ 840],
                [7920]])

        R   (   R=   RM   t   prodRT   R}   (   R   R{   R2   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR…   /  s    c         C` s%   t  j j |  | | d t ƒj | ƒ S(   sG  
        Test whether any array element along a given axis evaluates to True.

        Refer to `numpy.any` for full documentation.

        Parameters
        ----------
        axis : int, optional
            Axis along which logical OR is performed
        out : ndarray, optional
            Output to existing array instead of creating new one, must have
            same shape as expected output

        Returns
        -------
            any : bool, ndarray
                Returns a single bool if `axis` is ``None``; otherwise,
                returns `ndarray`

        R   (   R=   RM   t   anyRT   R}   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR†   P  s    c         C` s%   t  j j |  | | d t ƒj | ƒ S(   sì  
        Test whether all matrix elements along a given axis evaluate to True.

        Parameters
        ----------
        See `numpy.all` for complete descriptions

        See Also
        --------
        numpy.all

        Notes
        -----
        This is the same as `ndarray.all`, but it returns a `matrix` object.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> y = x[0]; y
        matrix([[0, 1, 2, 3]])
        >>> (x == y)
        matrix([[ True,  True,  True,  True],
                [False, False, False, False],
                [False, False, False, False]], dtype=bool)
        >>> (x == y).all()
        False
        >>> (x == y).all(0)
        matrix([[False, False, False, False]], dtype=bool)
        >>> (x == y).all(1)
        matrix([[ True],
                [False],
                [False]], dtype=bool)

        R   (   R=   RM   t   allRT   R}   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR‡   g  s    &c         C` s%   t  j j |  | | d t ƒj | ƒ S(   sÚ  
        Return the maximum value along an axis.

        Parameters
        ----------
        See `amax` for complete descriptions

        See Also
        --------
        amax, ndarray.max

        Notes
        -----
        This is the same as `ndarray.max`, but returns a `matrix` object
        where `ndarray.max` would return an ndarray.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.max()
        11
        >>> x.max(0)
        matrix([[ 8,  9, 10, 11]])
        >>> x.max(1)
        matrix([[ 3],
                [ 7],
                [11]])

        R   (   R=   RM   t   maxRT   R}   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyRˆ   �  s    !c         C` s   t  j j |  | | ƒ j | ƒ S(   sì  
        Indices of the maximum values along an axis.

        Parameters
        ----------
        See `numpy.argmax` for complete descriptions

        See Also
        --------
        numpy.argmax

        Notes
        -----
        This is the same as `ndarray.argmax`, but returns a `matrix` object
        where `ndarray.argmax` would return an `ndarray`.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.argmax()
        11
        >>> x.argmax(0)
        matrix([[2, 2, 2, 2]])
        >>> x.argmax(1)
        matrix([[3],
                [3],
                [3]])

        (   R=   RM   t   argmaxR|   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR‰   ²  s    !c         C` s%   t  j j |  | | d t ƒj | ƒ S(   sð  
        Return the minimum value along an axis.

        Parameters
        ----------
        See `amin` for complete descriptions.

        See Also
        --------
        amin, ndarray.min

        Notes
        -----
        This is the same as `ndarray.min`, but returns a `matrix` object
        where `ndarray.min` would return an ndarray.

        Examples
        --------
        >>> x = -np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[  0,  -1,  -2,  -3],
                [ -4,  -5,  -6,  -7],
                [ -8,  -9, -10, -11]])
        >>> x.min()
        -11
        >>> x.min(0)
        matrix([[ -8,  -9, -10, -11]])
        >>> x.min(1)
        matrix([[ -3],
                [ -7],
                [-11]])

        R   (   R=   RM   t   minRT   R}   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyRŠ   Õ  s    !c         C` s   t  j j |  | | ƒ j | ƒ S(   s  
        Return the indices of the minimum values along an axis.

        Parameters
        ----------
        See `numpy.argmin` for complete descriptions.

        See Also
        --------
        numpy.argmin

        Notes
        -----
        This is the same as `ndarray.argmin`, but returns a `matrix` object
        where `ndarray.argmin` would return an `ndarray`.

        Examples
        --------
        >>> x = -np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[  0,  -1,  -2,  -3],
                [ -4,  -5,  -6,  -7],
                [ -8,  -9, -10, -11]])
        >>> x.argmin()
        11
        >>> x.argmin(0)
        matrix([[2, 2, 2, 2]])
        >>> x.argmin(1)
        matrix([[3],
                [3],
                [3]])

        (   R=   RM   t   argminR|   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR‹   ø  s    !c         C` s   t  j j |  | | ƒ j | ƒ S(   sÀ  
        Peak-to-peak (maximum - minimum) value along the given axis.

        Refer to `numpy.ptp` for full documentation.

        See Also
        --------
        numpy.ptp

        Notes
        -----
        Same as `ndarray.ptp`, except, where that would return an `ndarray` object,
        this returns a `matrix` object.

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.ptp()
        11
        >>> x.ptp(0)
        matrix([[8, 8, 8, 8]])
        >>> x.ptp(1)
        matrix([[3],
                [3],
                [3]])

        (   R=   RM   t   ptpR|   (   R   R{   Rd   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyRŒ     s    c         C` sN   |  j  \ } } | | k r. d d l m } n d d l m } t | |  ƒ ƒ S(   s=  
        Returns the (multiplicative) inverse of invertible `self`.

        Parameters
        ----------
        None

        Returns
        -------
        ret : matrix object
            If `self` is non-singular, `ret` is such that ``ret * self`` ==
            ``self * ret`` == ``np.matrix(np.eye(self[0,:].size)`` all return
            ``True``.

        Raises
        ------
        numpy.linalg.LinAlgError: Singular matrix
            If `self` is singular.

        See Also
        --------
        linalg.inv

        Examples
        --------
        >>> m = np.matrix('[1, 2; 3, 4]'); m
        matrix([[1, 2],
                [3, 4]])
        >>> m.getI()
        matrix([[-2. ,  1. ],
                [ 1.5, -0.5]])
        >>> m.getI() * m
        matrix([[ 1.,  0.],
                [ 0.,  1.]])

        i    (   R5   (   t   pinv(   R8   t
   numpy.dualR5   R�   R   (   R   R?   R=   t   func(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   getI<  s
    %c         C` s
   |  j  ƒ  S(   s1  
        Return `self` as an `ndarray` object.

        Equivalent to ``np.asarray(self)``.

        Parameters
        ----------
        None

        Returns
        -------
        ret : ndarray
            `self` as an `ndarray`

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.getA()
        array([[ 0,  1,  2,  3],
               [ 4,  5,  6,  7],
               [ 8,  9, 10, 11]])

        (   Rr   (   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   getAh  s    c         C` s   |  j  ƒ  j ƒ  S(   s  
        Return `self` as a flattened `ndarray`.

        Equivalent to ``np.asarray(x).ravel()``

        Parameters
        ----------
        None

        Returns
        -------
        ret : ndarray
            `self`, 1-D, as an `ndarray`

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4))); x
        matrix([[ 0,  1,  2,  3],
                [ 4,  5,  6,  7],
                [ 8,  9, 10, 11]])
        >>> x.getA1()
        array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11])

        (   Rr   t   ravel(   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   getA1…  s    c         C` s
   |  j  ƒ  S(   s@  
        Returns the transpose of the matrix.

        Does *not* conjugate!  For the complex conjugate transpose, use `getH`.

        Parameters
        ----------
        None

        Returns
        -------
        ret : matrix object
            The (non-conjugated) transpose of the matrix.

        See Also
        --------
        transpose, getH

        Examples
        --------
        >>> m = np.matrix('[1, 2; 3, 4]')
        >>> m
        matrix([[1, 2],
                [3, 4]])
        >>> m.getT()
        matrix([[1, 3],
                [2, 4]])

        (   Rz   (   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   getT   s    c         C` s6   t  |  j j t j ƒ r( |  j ƒ  j ƒ  S|  j ƒ  Sd S(   sF  
        Returns the (complex) conjugate transpose of `self`.

        Equivalent to ``np.transpose(self)`` if `self` is real-valued.

        Parameters
        ----------
        None

        Returns
        -------
        ret : matrix object
            complex conjugate transpose of `self`

        Examples
        --------
        >>> x = np.matrix(np.arange(12).reshape((3,4)))
        >>> z = x - 1j*x; z
        matrix([[  0. +0.j,   1. -1.j,   2. -2.j,   3. -3.j],
                [  4. -4.j,   5. -5.j,   6. -6.j,   7. -7.j],
                [  8. -8.j,   9. -9.j,  10.-10.j,  11.-11.j]])
        >>> z.getH()
        matrix([[  0. +0.j,   4. +4.j,   8. +8.j],
                [  1. +1.j,   5. +5.j,   9. +9.j],
                [  2. +2.j,   6. +6.j,  10.+10.j],
                [  3. +3.j,   7. +7.j,  11.+11.j]])

        N(   t
   issubclassR2   R9   R=   t   complexfloatingRz   t	   conjugate(   R   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   getHÀ  s    t   docRz   s
   base arrays   1-d base arrays   hermitian (conjugate) transposet   inverseN(+   R   R   t   __doc__t   __array_priority__R   RT   RV   Rb   R   Rk   Rf   Rl   Rm   Rn   Ro   Rx   Ry   R|   R}   R~   R€   R�   R‚   R„   R…   R†   R‡   Rˆ   R‰   RŠ   R‹   RŒ   R�   R‘   R“   R”   R˜   t   propertyt   Tt   At   A1t   Ht   I(    (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR   Î   sL   $.									
				""""!(####!	,			 	"c         C` s  |  j  d ƒ } g  } xí | D]å } | j  d ƒ } g  } x! | D] } | j | j  ƒ  ƒ q> W| } g  }	 x~ | D]v }
 |
 j ƒ  }
 y | |
 } WnF t k
 rÖ y | |
 } Wq× t k
 rÒ t d |
 f ƒ ‚ q× Xn X|	 j | ƒ qn W| j t |	 d d ƒƒ q Wt | d d ƒS(   NR   R    s   %s not foundR{   iÿÿÿÿi    (   R!   R"   t   stript   KeyErrorR&   R   (   RO   t   gdictt   ldictR(   t   rowtupR+   R,   R-   R`   t   coltupR.   t   thismat(    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   _from_stringè  s*    c         C` s  t  |  t ƒ ra | d k r? t j ƒ  j } | j } | j } n | } | } t t	 |  | | ƒ ƒ St  |  t
 t f ƒ rä g  } xO |  D]G } t  | t j ƒ r± t t |  d d ƒƒ S| j t | d d ƒƒ qƒ Wt t | d d ƒƒ St  |  t j ƒ r t |  ƒ Sd S(   s  
    Build a matrix object from a string, nested sequence, or array.

    Parameters
    ----------
    obj : str or array_like
        Input data.  Names of variables in the current scope may be
        referenced, even if `obj` is a string.

    Returns
    -------
    out : matrix
        Returns a matrix object, which is a specialized 2-D array.

    See Also
    --------
    matrix

    Examples
    --------
    >>> A = np.mat('1 1; 1 1')
    >>> B = np.mat('2 2; 2 2')
    >>> C = np.mat('3 4; 5 6')
    >>> D = np.mat('7 8; 9 0')

    All the following expressions construct the same block matrix:

    >>> np.bmat([[A, B], [C, D]])
    matrix([[1, 1, 2, 2],
            [1, 1, 2, 2],
            [3, 4, 7, 8],
            [5, 6, 9, 0]])
    >>> np.bmat(np.r_[np.c_[A, B], np.c_[C, D]])
    matrix([[1, 1, 2, 2],
            [1, 1, 2, 2],
            [3, 4, 7, 8],
            [5, 6, 9, 0]])
    >>> np.bmat('A,B; C,D')
    matrix([[1, 1, 2, 2],
            [1, 1, 2, 2],
            [3, 4, 7, 8],
            [5, 6, 9, 0]])

    R{   iÿÿÿÿi    N(   RK   RO   R   t   syst	   _getframet   f_backt	   f_globalst   f_localsR   Rª   R^   Rg   R=   RM   R   R&   (   R_   R¦   R¥   t   framet	   glob_dictt   loc_dictt   arr_rowsR+   (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyR     s"    -	(%   t
   __future__R    R   R   t   __all__R«   t   numpy.core.numerict   coret   numericR=   R   R   R	   R
   R   t   numpy.core.numerictypesR   R   t   version_infoR   R   R   R   R<   RG   R   Ru   R   R&   R1   R   RH   RM   R   Rª   R   R   (    (    (    sS   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/numpy/matrixlib/defmatrix.pyt   <module>   s>   (			 	lÿ ÿ ÿ 	E