ó
î&]\c           @` sw   d  Z  d d l m Z m Z m Z d d l Z d d l m Z d d l	 m
 Z
 d d d „ Z d e f d	 „  ƒ  YZ d S(
   s   Tests for _sketches.py.i    (   t   divisiont   print_functiont   absolute_importN(   t   clarkson_woodruff_transform(   t   assert_g{®Gáz„?c         C` sB   t  j j d ƒ t  j j | | |  | ƒ } t  j | |  | f ƒ S(   s@   
    Make some random data with Gaussian distributed values
    iÙ|(   t   npt   randomt   seedt   normalt   reshape(   t   n_rowst	   n_columnst   mut   sigmat   res(    (    s?   lib/python2.7/site-packages/scipy/linalg/tests/test_sketches.pyt!   make_random_dense_gaussian_matrix
   s    t   TestClarksonWoodruffTransformc           B` sG   e  Z d  Z d Z d Z d Z d Z e e e ƒ Z d „  Z	 d „  Z
 RS(   s1   
    Testing the Clarkson Woodruff Transform
    iÐ  id   gš™™™™™¹?c         C` s?   t  |  j |  j ƒ } t | j |  j |  j j d f k ƒ d  S(   Ni   (   R   t   dense_big_matrixt   n_sketch_rowsR   t   shape(   t   selft   sketch(    (    s?   lib/python2.7/site-packages/scipy/linalg/tests/test_sketches.pyt   test_sketch_dimensions$   s    	c      
   C` s¨   d } d d d d d d d d	 d
 d g
 } xg | D]_ } t  |  j |  j | ƒ } t j j |  j ƒ t j j | ƒ } | |  j k r1 | d 7} q1 q1 Wt | d k ƒ d  S(   Ni    iÚ¦¢hi¾v±7ižSòRir6xhi'@½wiÚ·¡Mi…ã©ZiÀTzYi¹ñ CiUÔf[i   (   R   R   R   R   t   linalgt   normt	   thresholdR   (   R   t   n_errorst   seedst   seed_R   t   err(    (    s?   lib/python2.7/site-packages/scipy/linalg/tests/test_sketches.pyt   test_sketch_rows_norm+   s    	%(   t   __name__t
   __module__t   __doc__t   n_matrix_rowst   n_matrix_columnsR   R   R   R   R   R   (    (    (    s?   lib/python2.7/site-packages/scipy/linalg/tests/test_sketches.pyR      s   		(   R!   t
   __future__R    R   R   t   numpyR   t   scipy.linalgR   t   numpy.testingR   R   t   objectR   (    (    (    s?   lib/python2.7/site-packages/scipy/linalg/tests/test_sketches.pyt   <module>   s   	