#NEWLINE# def test_random_complex( self ) : #NEWLINE# #INDENT# n = 20 #NEWLINE# m = 15 #NEWLINE# for i in range ( 3 ) : #NEWLINE# #INDENT# for full_matrices in ( True , False ) : #NEWLINE# #INDENT# for a in [ random ( [ n , m ] ) , random ( [ m , n ] ) ] : #NEWLINE# #INDENT# a = ( a + ( 1j * random ( list ( a . shape ) ) ) ) #NEWLINE# ( u , s , vh ) = svd ( a , full_matrices = full_matrices , lapack_driver = self . lapack_driver ) #NEWLINE# assert_array_almost_equal ( dot ( conj ( transpose ( u ) ) , u ) , identity ( u . shape [ 1 ] ) ) #NEWLINE# sigma = zeros ( ( u . shape [ 1 ] , vh . shape [ 0 ] ) , s . dtype . char ) #NEWLINE# for i in range ( len ( s ) ) : #NEWLINE# #INDENT# sigma [ ( i , i ) ] = s [ i ] #NEWLINE# #UNINDENT# assert_array_almost_equal ( dot ( dot ( u , sigma ) , vh ) , a )