@@ -76,19 +76,9 @@ using FillArrays: SquareEye
7676 @test iszero (R)
7777 @test R isa Zeros
7878
79- A = Zeros (3 , 4 )
80- L, Q = @constinferred lq_compact (A)
81- @test L * Q == A
82- @test size (L) == (3 , 3 )
83- @test size (Q) == (3 , 4 )
84- @test iszero (L)
85- @test L isa Zeros
86- @test Q == Matrix (I, (3 , 4 ))
87- @test Q isa Eye
88-
8979 for f in (lq_compact, right_orth)
9080 A = Zeros (3 , 4 )
91- L, Q = @constinferred lq_compact (A)
81+ L, Q = @constinferred f (A)
9282 @test L * Q == A
9383 @test L == Zeros (3 , 3 )
9484 @test L isa Zeros
@@ -211,69 +201,73 @@ end
211201 end
212202 end
213203
214- # A = Eye(4, 3)
215- # Q, R = @constinferred qr_compact(A)
216- # @test Q * R == A
217- # @test size(Q) == (4, 3)
218- # @test size(R) == (3, 3)
219- # @test Q == Matrix(I, (4, 3))
220- # @test Q isa Eye
221- # @test R == I
222- # @test R isa Eye
223-
224- # A = Eye(3)
225- # Q, R = @constinferred qr_compact(A)
226- # @test Q * R == A
227- # @test Q === A
228- # @test R === A
229-
230- # A = Eye(4, 3)
231- # Q, R = @constinferred qr_full(A)
232- # @test Q * R == A
233- # @test size(Q) == (4, 4)
234- # @test size(R) == (4, 3)
235- # @test Q == I
236- # @test Q isa Eye
237- # @test R == I
238- # @test R isa Eye
239-
240- # A = Eye(3)
241- # Q, R = @constinferred qr_full(A)
242- # @test Q * R == A
243- # @test Q === A
244- # @test R === A
245-
246- # A = Eye(4, 3)
247- # Q, R = @constinferred left_polar(A)
248- # @test Q * R == A
249- # @test size(Q) == (4, 3)
250- # @test size(R) == (3, 3)
251- # @test Q == Matrix(I, (4, 3))
252- # @test Q isa Eye
253- # @test R == I
254- # @test R isa Eye
255-
256- # A = Eye(3)
257- # Q, R = @constinferred left_polar(A)
258- # @test Q * R == A
259- # @test Q === A
260- # @test R === A
204+ for f in (qr_compact, left_orth)
205+ A = Eye (4 , 3 )
206+ Q, R = @constinferred f (A)
207+ @test Q * R == A
208+ @test size (Q) == (4 , 3 )
209+ @test size (R) == (3 , 3 )
210+ @test Q == Matrix (I, (4 , 3 ))
211+ @test Q isa Eye
212+ @test R == I
213+ @test R isa Eye
261214
262- A = Eye (3 , 4 )
263- L, Q = @constinferred lq_compact (A)
264- @test L * Q == A
265- @test size (L) == (3 , 3 )
266- @test size (Q) == (3 , 4 )
267- @test L == I
268- @test L isa Eye
269- @test Q == Matrix (I, (3 , 4 ))
215+ A = Eye (3 )
216+ Q, R = @constinferred f (A)
217+ @test Q * R == A
218+ @test Q === A
219+ @test R === A
220+ end
221+
222+ A = Eye (4 , 3 )
223+ Q, R = @constinferred qr_full (A)
224+ @test Q * R == A
225+ @test size (Q) == (4 , 4 )
226+ @test size (R) == (4 , 3 )
227+ @test Q == I
270228 @test Q isa Eye
229+ @test R == Eye (4 , 3 )
230+ @test R isa Eye
271231
272232 A = Eye (3 )
273- L, Q = @constinferred lq_compact (A)
274- @test L * Q == A
275- @test L === A
233+ Q, R = @constinferred qr_full (A)
234+ @test Q * R == A
276235 @test Q === A
236+ @test R === A
237+
238+ A = Eye (4 , 3 )
239+ Q, R = @constinferred left_polar (A)
240+ @test Q * R == A
241+ @test size (Q) == (4 , 3 )
242+ @test size (R) == (3 , 3 )
243+ @test Q == Matrix (I, (4 , 3 ))
244+ @test Q isa Eye
245+ @test R == I
246+ @test R isa Eye
247+
248+ A = Eye (3 )
249+ Q, R = @constinferred left_polar (A)
250+ @test Q * R == A
251+ @test Q === A
252+ @test R === A
253+
254+ for f in (lq_compact, right_orth)
255+ A = Eye (3 , 4 )
256+ L, Q = @constinferred lq_compact (A)
257+ @test L * Q == A
258+ @test size (L) == (3 , 3 )
259+ @test size (Q) == (3 , 4 )
260+ @test L == I
261+ @test L isa Eye
262+ @test Q == Matrix (I, (3 , 4 ))
263+ @test Q isa Eye
264+
265+ A = Eye (3 )
266+ L, Q = @constinferred lq_compact (A)
267+ @test L * Q == A
268+ @test L === A
269+ @test Q === A
270+ end
277271
278272 A = Eye (3 , 4 )
279273 L, Q = @constinferred lq_full (A)
@@ -291,21 +285,21 @@ end
291285 @test L === A
292286 @test Q === A
293287
294- # A = Eye(3, 4)
295- # L, Q = @constinferred right_polar(A)
296- # @test L * Q == A
297- # @test size(L) == (3, 3)
298- # @test size(Q) == (3, 4)
299- # @test L == I
300- # @test L isa Eye
301- # @test Q == Matrix(I, (3, 4))
302- # @test Q isa Eye
303-
304- # A = Eye(3)
305- # L, Q = @constinferred right_polar(A)
306- # @test L * Q == A
307- # @test L === A
308- # @test Q === A
288+ A = Eye (3 , 4 )
289+ L, Q = @constinferred right_polar (A)
290+ @test L * Q == A
291+ @test size (L) == (3 , 3 )
292+ @test size (Q) == (3 , 4 )
293+ @test L == I
294+ @test L isa Eye
295+ @test Q == Matrix (I, (3 , 4 ))
296+ @test Q isa Eye
297+
298+ A = Eye (3 )
299+ L, Q = @constinferred right_polar (A)
300+ @test L * Q == A
301+ @test L === A
302+ @test Q === A
309303
310304 A = Eye (3 , 4 )
311305 U, S, V = @constinferred svd_compact (A)
0 commit comments