#NEWLINE# def test_simple_tall_pivoting( self ) : #NEWLINE# #INDENT# a = np . asarray ( [ [ 8 , 2 ] , [ 2 , 9 ] , [ 5 , 3 ] ] ) #NEWLINE# ( q , r , p ) = qr ( a , pivoting = True ) #NEWLINE# d = abs ( diag ( r ) ) #NEWLINE# assert_ ( all ( ( d [ 1 : ] <= d [ : ( - 1 ) ] ) ) ) #NEWLINE# assert_array_almost_equal ( dot ( transpose ( q2 ) , q ) , identity ( 3 ) ) #NEWLINE# assert_array_almost_equal ( dot ( q , r ) , a [ : , p ] ) #NEWLINE# ( q2 , r2 ) = qr ( a [ : , p ] ) #NEWLINE# assert_array_almost_equal ( q , q2 ) #NEWLINE# assert_array_almost_equal ( r , r2 )