We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
lq
AbstractMatrix
1 parent aa7d879 commit b673576Copy full SHA for b673576
stdlib/LinearAlgebra/src/lq.jl
@@ -107,8 +107,10 @@ julia> l == S.L && q == S.Q
107
true
108
```
109
"""
110
-lq(A::StridedMatrix{<:BlasFloat}) = lq!(copy(A))
111
-lq(x::Number) = lq(fill(x,1,1))
+lq(A::AbstractMatrix{T}) where {T} = lq!(copy_oftype(A, lq_eltype(T)))
+lq(x::Number) = lq!(fill(convert(lq_eltype(typeof(x)), x), 1, 1))
112
+
113
+lq_eltype(::Type{T}) where {T} = typeof(zero(T) / sqrt(abs2(one(T))))
114
115
copy(A::LQ) = LQ(copy(A.factors), copy(A.τ))
116
0 commit comments