mò
—´“Ac           @   s   d  f  d „  ƒ  YZ  d S(   t   Matrixc           B   s&   t  Z d  d „ Z d „  Z d „  Z RS(   Nc         C   s}   | |  _ | |  _ | d j o, g  } | D] } | | | q* ~ |  _	 n/ g  } t
 | | ƒ D] } | d q` ~ |  _	 d S(   sÕ   
        Create a matrix over a finite field.
        INPUT:
            p -- prime
            n -- positive integer
            entries -- entries of the matrix (defaults to None, which means 0 matrix).
        i    N(   t   nt   selft
   _Matrix__nt   pt
   _Matrix__pt   entriest   Nonet   _[1]t   xt   _Matrix__entriest   ranget   _(   R   R   R   R   R   R	   R   (    (    t   mult1.pyt   __init__   s     		,c         C   sh   d } |  i } xR t | ƒ D]D } x1 t | ƒ D]# } | d |  i | | | 7} q/ W| d 7} q W| S(   Nt    s   %s, s   
(   t   sR   R   R   R   t   it   jR
   (   R   R   R   R   R   (    (    R   t   __repr__   s    	  !c   	   	   C   só   t  | t ƒ o& |  i | i j o |  i | i j p
 t d ‚ g  } |  i } xŽ t	 | ƒ D]€ } xw t	 | ƒ D]i } g  } t	 | ƒ D]/ } | |  i | | | | i | | | q† ~ } | i t | ƒ |  i ƒ qo Wq\ Wt |  i | | ƒ S(   Ns   Incompatible multiply.(   t
   isinstancet   otherR    R   R   R   t   AssertionErrort   ansR   R   R   R   R   t   kR
   t   vt   appendt   sum(	   R   R   R   R   R   R   R   R   R   (    (    R   t   __mul__   s    @	  I"(   t   __name__t
   __module__R   R   R   R   (    (    (    R   R       s   		N(   R    (   R    (    (    R   t   ?   s    