Skip to content

Commit

Permalink
fix fallback for scaling blas number with array
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored and mfasi committed Sep 5, 2016
1 parent 406cd7b commit 53ef6d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions base/linalg/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const ASUM_CUTOFF = 32
const NRM2_CUTOFF = 32

function scale!{T<:BlasFloat}(X::Array{T}, s::T)
s == 0 && return fill!(X, zero(T))
s == 1 && return X
if length(X) < SCAL_CUTOFF
generic_scale!(X, s)
else
Expand All @@ -18,6 +20,8 @@ function scale!{T<:BlasFloat}(X::Array{T}, s::T)
X
end

scale!{T<:BlasFloat}(s::T, X::Array{T}) = scale!(X, s)

scale!{T<:BlasFloat}(X::Array{T}, s::Number) = scale!(X, convert(T, s))
function scale!{T<:BlasComplex}(X::Array{T}, s::Real)
R = typeof(real(zero(T)))
Expand Down

0 comments on commit 53ef6d7

Please sign in to comment.