@@ -73,7 +73,7 @@ def test_block_diag(rgen):
7373@pt .mark .parametrize ('piter_normalizer' , [None , 'qr' , 'lu' , 'auto' ])
7474def test_approximate_range_finder (rows , cols , rank , dtype , piter_normalizer , rgen ):
7575 # only guaranteed to work for low-rank matrices
76- if rank is 'fullrank' :
76+ if rank == 'fullrank' :
7777 return
7878
7979 rf_size = rank + 10
@@ -84,9 +84,8 @@ def test_approximate_range_finder(rows, cols, rank, dtype, piter_normalizer, rge
8484 Q = em .approx_range_finder (A , rf_size , 7 , randstate = rgen ,
8585 piter_normalizer = piter_normalizer )
8686
87- Q = np .asmatrix (Q )
8887 assert Q .shape == (rows , rf_size )
89- normdist = np .linalg .norm (A - Q * (Q .H * A ), ord = 'fro' )
88+ normdist = np .linalg .norm (A - Q @ (Q .T . conj () @ A ), ord = 'fro' )
9089 assert normdist < 1e-7
9190
9291
@@ -98,7 +97,7 @@ def test_approximate_range_finder(rows, cols, rank, dtype, piter_normalizer, rge
9897 (20 , mptest .random_fullrank )])
9998def test_randomized_svd (rows , cols , rank , dtype , transpose , n_iter , target_gen ,
10099 rgen ):
101- rank = min (rows , cols ) - 2 if rank is 'fullrank' else rank
100+ rank = min (rows , cols ) - 2 if rank == 'fullrank' else rank
102101 A = target_gen (rows , cols , rank = rank , randstate = rgen , dtype = dtype )
103102
104103 U_ref , s_ref , V_ref = utils .truncated_svd (A , k = rank )
0 commit comments