Skip to content

Commit

Permalink
use egal when testing Val{true}/Val{false}
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolewski committed Dec 7, 2015
1 parent 5a0ed4a commit 01f26af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions base/linalg/lu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ LU{T}(factors::AbstractMatrix{T}, ipiv::Vector{BlasInt}, info::BlasInt) = LU{T,t

# StridedMatrix
function lufact!{T<:BlasFloat}(A::StridedMatrix{T}, pivot::Union{Type{Val{false}}, Type{Val{true}}} = Val{true})
pivot==Val{false} && return generic_lufact!(A, pivot)
if pivot === Val{false}
return generic_lufact!(A, pivot)
end
lpt = LAPACK.getrf!(A)
return LU{T,typeof(A)}(lpt[1], lpt[2], lpt[3])
end
Expand Down Expand Up @@ -233,7 +235,7 @@ function lufact!{T}(A::Tridiagonal{T}, pivot::Union{Type{Val{false}}, Type{Val{t
end
for i = 1:n-2
# pivot or not?
if pivot==Val{false} || abs(d[i]) >= abs(dl[i])
if pivot === Val{false} || abs(d[i]) >= abs(dl[i])
# No interchange
if d[i] != 0
fact = dl[i]/d[i]
Expand All @@ -256,7 +258,7 @@ function lufact!{T}(A::Tridiagonal{T}, pivot::Union{Type{Val{false}}, Type{Val{t
end
if n > 1
i = n-1
if pivot==Val{false} || abs(d[i]) >= abs(dl[i])
if pivot === Val{false} || abs(d[i]) >= abs(dl[i])
if d[i] != 0
fact = dl[i]/d[i]
dl[i] = fact
Expand Down

0 comments on commit 01f26af

Please sign in to comment.