#NEWLINE# def test_random_tall_e_pivoting( self ) : #NEWLINE# #INDENT# m = 200 #NEWLINE# n = 100 #NEWLINE# for k in range ( 2 ) : #NEWLINE# #INDENT# a = random ( [ m , n ] ) #NEWLINE# ( q , r , p ) = qr ( a , pivoting = True , mode = 'economic' ) #NEWLINE# d = abs ( diag ( r ) ) #NEWLINE# assert_ ( all ( ( d [ 1 : ] <= d [ : ( - 1 ) ] ) ) ) #NEWLINE# assert_array_almost_equal ( dot ( transpose ( q ) , q ) , identity ( n ) ) #NEWLINE# assert_array_almost_equal ( dot ( q , r ) , a [ : , p ] ) #NEWLINE# assert_equal ( q . shape , ( m , n ) ) #NEWLINE# assert_equal ( r . shape , ( n , n ) ) #NEWLINE# ( q2 , r2 ) = qr ( a [ : , p ] , mode = 'economic' ) #NEWLINE# assert_array_almost_equal ( q , q2 ) #NEWLINE# assert_array_almost_equal ( r , r2 )