Skip to content

Commit fc2b43c

Browse files
committed
Deprecate qrfact to qr.
1 parent 658318e commit fc2b43c

File tree

15 files changed

+137
-175
lines changed

15 files changed

+137
-175
lines changed

NEWS.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ This section lists changes that do not have deprecation warnings.
239239
* `lq` methods now return decomposition objects such as `LQ`
240240
rather than tuples of arrays ([#27159]).
241241

242+
* `qr` methods now return decomposition objects such as `QR`, `QRPivoted`,
243+
and `QRCompactWY` rather than tuples of arrays ([#27159]).
244+
242245
* `countlines` now always counts the last non-empty line even if it does not
243246
end with EOL, matching the behavior of `eachline` and `readlines` ([#25845]).
244247

@@ -687,8 +690,8 @@ Deprecated or removed
687690
* The keyword `immutable` is fully deprecated to `struct`, and
688691
`type` is fully deprecated to `mutable struct` ([#19157], [#20418]).
689692

690-
* `lufact`, `eigfact`, `schurfact`, and `lqfact` have respectively been
691-
deprecated to `lu`, `eig`, `schur`, and `lq` ([#27159]).
693+
* `lufact`, `eigfact`, `schurfact`, `lqfact`, and `qrfact` have respectively
694+
been deprecated to `lu`, `eig`, `schur`, `lq`, and `qr` ([#27159]).
692695

693696
* Indexing into multidimensional arrays with more than one index but fewer indices than there are
694697
dimensions is no longer permitted when those trailing dimensions have lengths greater than 1.

doc/src/manual/arrays.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -746,37 +746,37 @@ creating any temporaries, and by calling the appropriate LAPACK function with th
746746
dimension size and stride parameters.
747747

748748
```julia-repl
749-
julia> a = rand(10,10)
749+
julia> a = rand(10, 10)
750750
10×10 Array{Float64,2}:
751-
0.561255 0.226678 0.203391 0.308912 … 0.750307 0.235023 0.217964
752-
0.718915 0.537192 0.556946 0.996234 0.666232 0.509423 0.660788
753-
0.493501 0.0565622 0.118392 0.493498 0.262048 0.940693 0.252965
754-
0.0470779 0.736979 0.264822 0.228787 0.161441 0.897023 0.567641
755-
0.343935 0.32327 0.795673 0.452242 0.468819 0.628507 0.511528
756-
0.935597 0.991511 0.571297 0.74485 … 0.84589 0.178834 0.284413
757-
0.160706 0.672252 0.133158 0.65554 0.371826 0.770628 0.0531208
758-
0.306617 0.836126 0.301198 0.0224702 0.39344 0.0370205 0.536062
759-
0.890947 0.168877 0.32002 0.486136 0.096078 0.172048 0.77672
760-
0.507762 0.573567 0.220124 0.165816 0.211049 0.433277 0.539476
751+
0.517515 0.0348206 0.749042 0.0979679 … 0.75984 0.950481 0.579513
752+
0.901092 0.873479 0.134533 0.0697848 0.0586695 0.193254 0.726898
753+
0.976808 0.0901881 0.208332 0.920358 0.288535 0.705941 0.337137
754+
0.657127 0.0317896 0.772837 0.534457 0.0966037 0.700694 0.675999
755+
0.471777 0.144969 0.0718405 0.0827916 0.527233 0.173132 0.694304
756+
0.160872 0.455168 0.489254 0.827851 … 0.62226 0.0995456 0.946522
757+
0.291857 0.769492 0.68043 0.629461 0.727558 0.910796 0.834837
758+
0.775774 0.700731 0.700177 0.0126213 0.00822304 0.327502 0.955181
759+
0.9715 0.64354 0.848441 0.241474 0.591611 0.792573 0.194357
760+
0.646596 0.575456 0.0995212 0.038517 0.709233 0.477657 0.0507231
761761
762762
julia> b = view(a, 2:2:8,2:2:4)
763-
4×2 SubArray{Float64,2,Array{Float64,2},Tuple{StepRange{Int64,Int64},StepRange{Int64,Int64}},false}:
764-
0.537192 0.996234
765-
0.736979 0.228787
766-
0.991511 0.74485
767-
0.836126 0.0224702
763+
4×2 view(::Array{Float64,2}, 2:2:8, 2:2:4) with eltype Float64:
764+
0.873479 0.0697848
765+
0.0317896 0.534457
766+
0.455168 0.827851
767+
0.700731 0.0126213
768768
769-
julia> (q,r) = qr(b);
769+
julia> (q, r) = qr(b);
770770
771771
julia> q
772-
2 Array{Float64,2}:
773-
-0.338809 0.78934
774-
-0.464815 -0.230274
775-
-0.625349 0.194538
776-
-0.527347 -0.534856
772+
4 LinearAlgebra.QRCompactWYQ{Float64,Array{Float64,2}}:
773+
-0.722358 0.227524 -0.247784 -0.604181
774+
-0.0262896 -0.575919 -0.804227 0.144377
775+
-0.376419 -0.75072 0.540177 -0.0541979
776+
-0.579497 0.230151 -0.00552346 0.781782
777777
778778
julia> r
779779
2×2 Array{Float64,2}:
780-
-1.58553 -0.921517
781-
0.0 0.866567
780+
-1.20921 -0.383393
781+
0.0 -0.910506
782782
```

stdlib/LinearAlgebra/docs/src/index.md

-2
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,6 @@ LinearAlgebra.lowrankdowndate!
323323
LinearAlgebra.ldltfact
324324
LinearAlgebra.ldltfact!
325325
LinearAlgebra.qr
326-
LinearAlgebra.qr!
327-
LinearAlgebra.qrfact
328326
LinearAlgebra.qrfact!
329327
LinearAlgebra.QR
330328
LinearAlgebra.QRCompactWY

stdlib/LinearAlgebra/src/LinearAlgebra.jl

-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ export
125125
pinv,
126126
qr,
127127
qrfact!,
128-
qrfact,
129128
lq,
130129
lqfact!,
131130
rank,

stdlib/LinearAlgebra/src/dense.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ systems. For example: `A=factorize(A); x=A\\b; y=A\\C`.
11211121
| Tridiagonal | LU (see [`lu`](@ref)) |
11221122
| Symmetric real tridiagonal | LDLt (see [`ldltfact`](@ref)) |
11231123
| General square | LU (see [`lu`](@ref)) |
1124-
| General non-square | QR (see [`qrfact`](@ref)) |
1124+
| General non-square | QR (see [`qr`](@ref)) |
11251125
11261126
If `factorize` is called on a Hermitian positive-definite matrix, for instance, then `factorize`
11271127
will return a Cholesky factorization.
@@ -1220,7 +1220,7 @@ function factorize(A::StridedMatrix{T}) where T
12201220
end
12211221
return lu(A)
12221222
end
1223-
qrfact(A, Val(true))
1223+
qr(A, Val(true))
12241224
end
12251225
factorize(A::Adjoint) = adjoint(factorize(parent(A)))
12261226
factorize(A::Transpose) = transpose(factorize(parent(A)))

stdlib/LinearAlgebra/src/deprecated.jl

+7
Original file line numberDiff line numberDiff line change
@@ -1300,3 +1300,10 @@ export schurfact
13001300
export lqfact
13011301
@deprecate lqfact(A::StridedMatrix{<:BlasFloat}) lq(A)
13021302
@deprecate lqfact(x::Number) lq(x)
1303+
1304+
# deprecate qrfact to qr
1305+
export qrfact
1306+
@deprecate(qrfact(x::Number), qr(x))
1307+
@deprecate(qrfact(v::AbstractVector), qr(v))
1308+
@deprecate(qrfact(A::AbstractMatrix{T}) where T, qr(A))
1309+
@deprecate(qrfact(A::AbstractMatrix{T}, arg) where T, qr(A, arg))

stdlib/LinearAlgebra/src/generic.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ function (\)(A::AbstractMatrix, B::AbstractVecOrMat)
864864
end
865865
return lu(A) \ B
866866
end
867-
return qrfact(A,Val(true)) \ B
867+
return qr(A,Val(true)) \ B
868868
end
869869

870870
(\)(a::AbstractVector, b::AbstractArray) = pinv(a) * b

0 commit comments

Comments
 (0)