ó
S™xTc           @   s9   d  d l  m Z d  d l Z d e j f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   divisionNt	   assistantc        	   B   sA   e  Z d  d d d d d d d d g	 Z d	 „  Z d d
 d „ Z RS(   t   lattice_groupt   intensity_groupt   miller_indicest   cb_opst   permst	   inv_permst   i_j_multiplication_tablet   i_inv_j_multiplication_tablet   i_j_inv_multiplication_tablec            s  | |  _  | |  _ | |  _ d d  l } d d  l } | j j j d | d | ƒ } | j d t	 ƒ } g  |  _
 g  |  _ g  |  _ x± | D]© } | j ƒ  j ƒ  s£ t ‚ | j j | ƒ } |  j
 j | ƒ | j | ƒ }	 | j j |	 | ƒ }
 |
 j ƒ  sü t ‚ |
 j ƒ  } |  j j | ƒ |  j j | j ƒ  ƒ q… Wi  ‰  xh t | j ƒ D]W \ } } xH | D]@ } | j ƒ  j ƒ  syt ‚ t | j ƒ  j ƒ  ƒ } | ˆ  | <q[WqHW‡  f d †  } g  | D] } | j ƒ  ^ q¹} | | | ƒ |  _ | | | ƒ |  _ | | | ƒ |  _  d  S(   Niÿÿÿÿt   gt   ht   omit_first_partitionc            s�   g  } x‚ |  D]z } g  } x^ | D]V } | j  | ƒ } | j ƒ  j ƒ  sM t ‚ t | j ƒ  j ƒ  ƒ } | j ˆ  | ƒ q  W| j | ƒ q W| S(   N(   t   multiplyt   tt   is_zerot   AssertionErrort   strt   rt   as_hklt   append(   t   reps_it   reps_jt   resultt   rep_it   rowt   rep_jt   st   key(   t   lookup_dict(    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/miller/reindexing.pyt   multiplication_table.   s    (!   R   R   R   t   cctbx.millert   cctbx.sgtbx.cosetst   sgtbxt   cosetst$   left_decomposition_point_groups_onlyt   best_partition_representativest   FalseR   R   R   R   R   R   t   change_of_basis_opR   t   applyt   millert   match_indicest   have_singlest   permutationt   inverse_permutationt	   enumeratet
   partitionsR   R   R   t   inverseR   R	   R
   (   t   OR   R   R   t   cctbxR#   t   repst   rept   cb_opt   mi_cbt   matchest   permt   i_partt   partR   R   R   t   _t   reps_inv(    (   R   sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/miller/reindexing.pyt   __init__   sB    							t    c   	   	      sO  ˆ  d  k r$ d d  l } | j ‰  n  ‡  ‡ f d †  } | d |  j ƒ | d |  j ƒ ˆ  ˆ j ƒ  IJt |  j ƒ d k r„ d } n$ t |  j ƒ d k r¢ d } n d	 } ˆ  ˆ | IJx’ t |  j |  j	 ƒ D]{ \ } } | j
 ƒ  j ƒ  j d ƒ } | j ƒ  sÌ ˆ  ˆ d
 | j ƒ  | j ƒ  j ƒ  | j | ƒ | k j t ƒ f IJqÌ qÌ W|  S(   Niÿÿÿÿc            s$   ˆ  ˆ |  I| j  ƒ  j ƒ  IJd  S(   N(   t   infot   symbol_and_number(   R   t   sg(   t   outt   prefix(    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/miller/reindexing.pyR;   B   s    s   Lattice symmetry:s   Intensity symmetry:i   s   No indexing ambiguity.i   s   Indexing ambiguity:s   Indexing ambiguities:s#     %-12s  %d-fold    invariants: %4d(   t   Nonet   syst   stdoutR   R   t   rstript   lenR   t   zipR   t   cR   t   new_denominatort
   is_unit_mxR   R?   t   typet   selectt   countt   True(	   R1   RB   RC   RE   R;   R   R5   R8   R   (    (   RB   RC   sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/miller/reindexing.pyt   show_summary>   s*    		"
	*N(   t   __name__t
   __module__t	   __slots__R=   RD   RQ   (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/miller/reindexing.pyR      s   		-(   t
   __future__R    t   libtbxt   slots_getstate_setstateR   (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/cctbx/miller/reindexing.pyt   <module>   s   