ó
^™xTc           @   sˆ   d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 d „  Z
 d d „ Z d	 „  Z e d
 k r„ e ƒ  n  d S(   iÿÿÿÿ(   t   division(   t   orthonormal_basis(   t   matrix(   t   approx_equal(   t   flexc          c   sg   t  j d ƒ t  j d ƒ f VxC t d ƒ D]5 }  t  j t j d ƒ ƒ t  j t j d ƒ ƒ f Vq* Wd  S(   Ni   i    i
   i   (   i   i    i   (   i   i   i   (   R   t   colt   xrangeR   t   random_double(   t   i(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_orthonormal_basis.pyt   input_pairs   s    gê-�™—q=c   
      C   s²  x«t  ƒ  D] \ } } g  t | | ƒ D] } t j | ƒ ^ q& } x, | D]$ } t | j ƒ  d |  ƒ sH t ‚ qH W| \ } } } t | j | ƒ | |  ƒ s  t ‚ t | d | d ƒ } t | d | |  ƒ sÑ t ‚ t | d | |  ƒ sí t ‚ t | d | |  ƒ s
t ‚ t | d | d ƒ } t | d | |  ƒ s;t ‚ t | d | |  ƒ sWt ‚ t | d | |  ƒ sst ‚ t | | d t ƒ}	 t |	 | | | f |  ƒ s
 t ‚ q
 Wd  S(   Ni   i   i    t   right_handed(	   R	   R   R   R   R   t   lengtht   AssertionErrort   crosst   False(
   t   epst   v0t   v1t   et   basist   e0t   e1t   e2t
   basis_permt   left_handed_basis(    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_orthonormal_basis.pyt   exercise_orthonormal_basis   s     +"!c           C   s   t  ƒ  d GHd  S(   Nt   OK(   R   (    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_orthonormal_basis.pyt   run!   s    t   __main__N(   t
   __future__R    t   scitbx.mathR   t   scitbxR   t   libtbx.test_utilsR   t   scitbx.array_familyR   R	   R   R   t   __name__(    (    (    sU   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/tests/tst_orthonormal_basis.pyt   <module>   s   		