Skip to content

Commit

Permalink
normalize! was only defined in JuliaLang/julia#13681 (Julia 0.5.0-dev…
Browse files Browse the repository at this point in the history
…+8353)
  • Loading branch information
stevengj committed Nov 17, 2015
1 parent 891cf5c commit da2a5e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,14 @@ function Base.norm{T<:Real}(x::Union{Vec{T},Vec{Complex{T}}}, p::Number)
v[1]
end

if version >= v"0.5.0-dev+8353" # JuliaLang/julia#13681
import Base.normalize!
else
export normalize!
end

# computes v = norm(x,2), divides x by v, and returns v
function Base.normalize!{T<:Scalar}(x::Vec{T})
function normalize!{T<:Scalar}(x::Vec{T})
v = Array(T, 1)
chk(C.VecNormalize(x.p, v))
v[1]
Expand Down

0 comments on commit da2a5e5

Please sign in to comment.