@@ -111,35 +111,35 @@ end
111
111
@testset " correct form of Q from lq(...) (#23729)" begin
112
112
# where the original matrix (say A) is square or has more rows than columns,
113
113
# then A's factorization's triangular factor (say L) should have the same shape
114
- # as A independent of factorization form (truncated, square ), and A's factorization's
114
+ # as A independent of factorization form (square, rectangular/"thin" ), and A's factorization's
115
115
# orthogonal factor (say Q) should be a square matrix of order of A's number of
116
- # columns independent of factorization form (truncated, square ), and L and Q
116
+ # columns independent of factorization form (square, rectangular/"thin" ), and L and Q
117
117
# should have multiplication-compatible shapes.
118
118
m, n = 4 , 2
119
119
A = randn (m, n)
120
- for thin in (true , false )
121
- L, Q = lq (A, thin = thin )
120
+ for square in (false , true )
121
+ L, Q = lq (A, square = square )
122
122
@test size (L) == (m, n)
123
123
@test size (Q) == (n, n)
124
124
@test isapprox (A, L* Q)
125
125
end
126
126
# where the original matrix has strictly fewer rows than columns ...
127
127
m, n = 2 , 4
128
128
A = randn (m, n)
129
- # ... then, for a truncated factorization of A, L should be a square matrix
129
+ # ... then, for a rectangular/"thin" factorization of A, L should be a square matrix
130
130
# of order of A's number of rows, Q should have the same shape as A,
131
131
# and L and Q should have multiplication-compatible shapes
132
- Lthin, Qthin = lq (A, thin = true )
133
- @test size (Lthin ) == (m, m)
134
- @test size (Qthin ) == (m, n)
135
- @test isapprox (A, Lthin * Qthin )
136
- # ... and, for a square/non-truncated factorization of A, L should have the
132
+ Lrect, Qrect = lq (A, square = false )
133
+ @test size (Lrect ) == (m, m)
134
+ @test size (Qrect ) == (m, n)
135
+ @test isapprox (A, Lrect * Qrect )
136
+ # ... and, for a square factorization of A, L should have the
137
137
# same shape as A, Q should be a square matrix of order of A's number of columns,
138
138
# and L and Q should have multiplication-compatible shape. but instead the L returned
139
- # has no zero-padding on the right / is L for the truncated factorization,
139
+ # has no zero-padding on the right / is L for the rectangular/"thin" factorization,
140
140
# so for L and Q to have multiplication-compatible shapes, L must be zero-padded
141
141
# to have the shape of A.
142
- Lsquare, Qsquare = lq (A, thin = false )
142
+ Lsquare, Qsquare = lq (A, square = true )
143
143
@test size (Lsquare) == (m, m)
144
144
@test size (Qsquare) == (n, n)
145
145
@test isapprox (A, [Lsquare zeros (m, n - m)] * Qsquare)
0 commit comments