Skip to content

Commit

Permalink
Adjust the value passed to qr
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Jul 19, 2017
1 parent 280c2fc commit 799ddaf
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -347,19 +347,27 @@ end

# qr, qrfact, qrfact!
let A = [1.0 2.0; 3.0 4.0]
Q, R = qr(A, Val(false))
# The constructor for qr changed to take Val{x} instead of Type{Val{x}}
if VERSION < v"0.7.0-DEV.843"
valtrue = Val{true}
valfalse = Val{false}
else
valtrue = Val(true)
valfalse = Val(false)
end
Q, R = qr(A, valfalse)
@test Q*R A
Q, R, p = qr(A, Val(true))
Q, R, p = qr(A, valtrue)
@test Q*R A[:,p]
F = qrfact(A, Val(false))
F = qrfact(A, valfalse)
@test F[:Q]*F[:R] A
F = qrfact(A, Val(true))
F = qrfact(A, valtrue)
@test F[:Q]*F[:R] A[:,F[:p]]
A_copy = copy(A)
F = qrfact!(A_copy, Val(false))
F = qrfact!(A_copy, valfalse)
@test F[:Q]*F[:R] A
A_copy = copy(A)
F = qrfact!(A_copy, Val(true))
F = qrfact!(A_copy, valtrue)
@test F[:Q]*F[:R] A[:,F[:p]]
end

Expand Down

0 comments on commit 799ddaf

Please sign in to comment.