Skip to content

Commit

Permalink
Merge pull request #230 from JuliaStats/anj/06
Browse files Browse the repository at this point in the history
Adjust VERSION condition to avoid using release branch versions
  • Loading branch information
andreasnoack committed Jan 20, 2017
2 parents 4cbc4e8 + 57fff72 commit 36e5b01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/moments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ function var!(R::AbstractArray, A::RealArray, wv::WeightVec, dim::Int; mean=noth
end

Base.varm(A::RealArray, wv::WeightVec, M::RealArray, dim::Int) =
@static if VERSION < v"0.5.1-pre+19"
@static if VERSION < v"0.6.0-dev.1121"
Base.varm!(similar(A, Float64, Base.reduced_dims(size(A), dim)), A, wv, M, dim)
else
Base.varm!(similar(A, Float64, Base.reduced_indices(indices(A), dim)), A, wv, M, dim)
end

Base.var(A::RealArray, wv::WeightVec, dim::Int; mean=nothing) =
@static if VERSION < v"0.5.1-pre+19"
@static if VERSION < v"0.6.0-dev.1121"
var!(similar(A, Float64, Base.reduced_dims(size(A), dim)), A, wv, dim; mean=mean)
else
var!(similar(A, Float64, Base.reduced_indices(indices(A), dim)), A, wv, dim; mean=mean)
Expand Down
4 changes: 2 additions & 2 deletions src/weights.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ end

function wsum{T<:Number,W<:Real}(A::AbstractArray{T}, w::AbstractVector{W}, dim::Int)
length(w) == size(A,dim) || throw(DimensionMismatch("Inconsistent array dimension."))
@static if VERSION < v"0.5.1-pre+19"
@static if VERSION < v"0.6.0-dev.1121"
_wsum!(similar(A, wsumtype(T,W), Base.reduced_dims(size(A), dim)), A, w, dim, true)
else
_wsum!(similar(A, wsumtype(T,W), Base.reduced_indices(indices(A), dim)), A, w, dim, true)
Expand Down Expand Up @@ -273,7 +273,7 @@ wmeantype{T,W}(::Type{T}, ::Type{W}) = typeof((zero(T)*zero(W) + zero(T)*zero(W)
wmeantype{T<:BlasReal}(::Type{T}, ::Type{T}) = T

Base.mean{T<:Number,W<:Real}(A::AbstractArray{T}, w::WeightVec{W}, dim::Int) =
@static if VERSION < v"0.5.1-pre+19"
@static if VERSION < v"0.6.0-dev.1121"
mean!(similar(A, wmeantype(T, W), Base.reduced_dims(size(A), dim)), A, w, dim)
else
mean!(similar(A, wmeantype(T, W), Base.reduced_indices(indices(A), dim)), A, w, dim)
Expand Down

0 comments on commit 36e5b01

Please sign in to comment.