ó
_™xTc           @   s…   d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d „  Z	 d „  Z
 e d k r� e
 d e j d ƒ n  d S(   iÿÿÿÿ(   t   divisionNc         C   sÔ   t  t j |  d  ƒ } | d  k r% d  Sd |  GHt d d ƒ t d
 d ƒ t d d ƒ } xv | D]n } xe | D]] } t j j | | ƒ } | d | d	 | ƒ } | | k rk t t	 | | | | f ƒ ƒ ‚ qk qk Wq^ Wd  S(   Ns#   compare_with_boost_rational_gcd(%s)iœÿÿÿie   i`yþÿi
   i   i † t   at   biVyþÿikyþÿi–† i«† (
   t   getattrt   scitbxt   matht   Nonet   ranget   boostt   rationalt   gcdt   RuntimeErrort   str(   t   labelt	   other_gcdt   samplesR   R   t   rt   o(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_gcd.pyt   compare_with_boost_rational_gcd   s     	)c   	      C   sG  t  |  ƒ d k r d } n( t  |  ƒ d k s3 t ‚ t |  d ƒ } d d d d d d	 d
 d g } x | D] } t d | ƒ qh Wg  | D] } t t j d | d  ƒ ^ q† } x� t | | ƒ D] \ } } | d  k rÙ q» n  t	 j	 ƒ  } t
 t j ƒ  d  ƒ } | | ƒ } d | | t	 j	 ƒ  | t
 t j ƒ  d  ƒ | f GHq» Wd GHd  S(   Ni    iè  i   t   gcd_int_boostt   gcd_int_simplet   gcd_int32_asmt   gcd_long_boostt   gcd_long_simplet   gcd_unsigned_long_binaryt   gcd_long_binaryt   gcd_int64_asmR   s   time_%si   s   %-24s %d w=%.2f u+s=%.2ft   OK(   t   lent   AssertionErrort   intR   R   R   R   R   t   zipt   timet   sumt   ost   times(	   t   argst   nt   labelsR   t   implst   implt   w0t   us0t   result(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_gcd.pyt   run   s8    		) !t   __main__R$   i   (   t
   __future__R    t   scitbx.mathR   t   boost.rationalR   R    t   sysR"   R   R,   t   __name__t   argv(    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_gcd.pyt   <module>   s   		"