#NEWLINE# def test_random_complex( self ) : #NEWLINE# #INDENT# n = 20 #NEWLINE# for k in range ( 2 ) : #NEWLINE# #INDENT# m = ( random ( [ n , n ] ) + ( 1j * random ( [ n , n ] ) ) ) #NEWLINE# for i in range ( n ) : #NEWLINE# #INDENT# m [ ( i , i ) ] = ( 20 * ( 0.1 + abs ( m [ ( i , i ) ] ) ) ) #NEWLINE# #UNINDENT# a = dot ( transpose ( conjugate ( m ) ) , m ) #NEWLINE# c = cholesky ( a ) #NEWLINE# a1 = dot ( transpose ( conjugate ( c ) ) , c ) #NEWLINE# assert_array_almost_equal ( a , a1 ) #NEWLINE# c = transpose ( c ) #NEWLINE# a = dot ( c , transpose ( conjugate ( c ) ) ) #NEWLINE# assert_array_almost_equal ( cholesky ( a , lower = 1 ) , c )