#NEWLINE# def test_lartg( ) : #NEWLINE# #INDENT# for dtype in 'fdFD' : #NEWLINE# #INDENT# lartg = get_lapack_funcs ( 'lartg' , dtype = dtype ) #NEWLINE# f = np . array ( 3 , dtype ) #NEWLINE# g = np . array ( 4 , dtype ) #NEWLINE# if np . iscomplexobj ( g ) : #NEWLINE# #INDENT# g *= 1j #NEWLINE# #UNINDENT# ( cs , sn , r ) = lartg ( f , g ) #NEWLINE# assert_allclose ( cs , ( 3.0 / 5.0 ) ) #NEWLINE# assert_allclose ( r , 5.0 ) #NEWLINE# if np . iscomplexobj ( g ) : #NEWLINE# #INDENT# assert_allclose ( sn , ( ( - 4j ) / 5.0 ) ) #NEWLINE# assert_ ( ( type ( r ) == complex ) ) #NEWLINE# assert_ ( ( type ( cs ) == float ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert_allclose ( cs , ( 4.0 / 5.0 ) )