Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions base/linalg/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ end
qrfact!{T<:BlasFloat}(A::StridedMatrix{T}, ::Type{Val{false}}) = QRCompactWY(LAPACK.geqrt!(A, min(minimum(size(A)), 36))...)
qrfact!{T<:BlasFloat}(A::StridedMatrix{T}, ::Type{Val{true}}) = QRPivoted(LAPACK.geqp3!(A)...)
qrfact!{T<:BlasFloat}(A::StridedMatrix{T}) = qrfact!(A, Val{false})
qrfact{T<:BlasFloat}(A::StridedMatrix{T}, arg) = qrfact!(copy(A), arg)
qrfact{T<:BlasFloat}(A::StridedMatrix{T}) = qrfact!(copy(A))

# Generic fallbacks
qrfact!(A::StridedMatrix, ::Type{Val{false}}) = qrfactUnblocked!(A)
qrfact!(A::StridedMatrix, ::Type{Val{true}}) = qrfactPivotedUnblocked!(A)
qrfact!(A::StridedMatrix) = qrfact!(A, Val{false})
qrfact{T}(A::StridedMatrix{T}, arg) = qrfact!(copy_oftype(A, typeof(zero(T)/norm(one(T)))), arg)
qrfact{T}(A::StridedMatrix{T}) = qrfact!(copy_oftype(A, typeof(zero(T)/norm(one(T)))))
qrfact{T}(A::AbstractMatrix{T}, arg) = qrfact!(copy_oftype(A, typeof(zero(T)/norm(one(T)))), arg)
qrfact{T}(A::AbstractMatrix{T}) = qrfact!(copy_oftype(A, typeof(zero(T)/norm(one(T)))))
qrfact(x::Number) = qrfact(fill(x,1,1))

qr(A::Union{Number, AbstractMatrix}, pivot::Union{Type{Val{false}}, Type{Val{true}}}=Val{false}; thin::Bool=true) =
Expand Down Expand Up @@ -541,4 +539,3 @@ end
## Lower priority: Add LQ, QL and RQ factorizations

# FIXME! Should add balancing option through xgebal

3 changes: 3 additions & 0 deletions test/linalg/qr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,6 @@ end

@test qr(Int[]) == (Int[],1)
@test Base.LinAlg.qr!(Int[1]) == (Int[1],1)

B = rand(7,2)
@test_approx_eq (1:7)\B collect(1:7)\B