Skip to content

Commit

Permalink
Add missing Base. prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Apr 27, 2018
1 parent b57b93c commit 043c9d0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/operators.jl
Expand Up @@ -497,28 +497,28 @@ function _fillwithzeros(arr::AbstractArray{T}) where T
end

for op in [:+, :-]; @eval begin
function $op(lhs::Number,rhs::AbstractArray{T}) where T<:JuMPTypes
function Base.$op(lhs::Number,rhs::AbstractArray{T}) where T<:JuMPTypes
ret = similar(rhs, typeof($op(lhs, zero(T))))
for I in eachindex(ret)
ret[I] = $op(lhs, rhs[I])
end
ret
end
function $op(lhs::AbstractArray{T},rhs::Number) where T<:JuMPTypes
function Base.$op(lhs::AbstractArray{T},rhs::Number) where T<:JuMPTypes
ret = similar(lhs, typeof($op(zero(T), rhs)))
for I in eachindex(ret)
ret[I] = $op(lhs[I], rhs)
end
ret
end
function $op(lhs::T,rhs::AbstractArray{S}) where {T<:JuMPTypes,S}
function Base.$op(lhs::T,rhs::AbstractArray{S}) where {T<:JuMPTypes,S}
ret = similar(rhs, typeof($op(lhs, zero(S))))
for I in eachindex(ret)
ret[I] = $op(lhs, rhs[I])
end
ret
end
function $op(lhs::AbstractArray{S},rhs::T) where {T<:JuMPTypes,S}
function Base.$op(lhs::AbstractArray{S},rhs::T) where {T<:JuMPTypes,S}
ret = similar(lhs, typeof($op(zero(S), rhs)))
for I in eachindex(ret)
ret[I] = $op(lhs[I], rhs)
Expand All @@ -528,28 +528,28 @@ for op in [:+, :-]; @eval begin
end; end

for op in [:*, :/]; @eval begin
function $op(lhs::Number,rhs::AbstractArray{T}) where T<:JuMPTypes
function Base.$op(lhs::Number,rhs::AbstractArray{T}) where T<:JuMPTypes
ret = similar(rhs, typeof($op(lhs, zero(T))))
for I in eachindex(ret)
ret[I] = $op(lhs, rhs[I])
end
ret
end
function $op(lhs::AbstractArray{T},rhs::Number) where T<:JuMPTypes
function Base.$op(lhs::AbstractArray{T},rhs::Number) where T<:JuMPTypes
ret = similar(lhs, typeof($op(zero(T), rhs)))
for I in eachindex(ret)
ret[I] = $op(lhs[I], rhs)
end
ret
end
function $op(lhs::T,rhs::AbstractArray{S}) where {T<:JuMPTypes,S}
function Base.$op(lhs::T,rhs::AbstractArray{S}) where {T<:JuMPTypes,S}
ret = similar(rhs, typeof($op(lhs, zero(S))))
for I in eachindex(ret)
ret[I] = $op(lhs, rhs[I])
end
ret
end
function $op(lhs::AbstractArray{S},rhs::T) where {T<:JuMPTypes,S}
function Base.$op(lhs::AbstractArray{S},rhs::T) where {T<:JuMPTypes,S}
ret = similar(lhs, typeof($op(zero(S), rhs)))
for I in eachindex(ret)
ret[I] = $op(lhs[I], rhs)
Expand Down

0 comments on commit 043c9d0

Please sign in to comment.