Skip to content

Commit

Permalink
Merge a2394f6 into 0d281d0
Browse files Browse the repository at this point in the history
  • Loading branch information
IainNZ committed Aug 27, 2018
2 parents 0d281d0 + a2394f6 commit 92fd62e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/JuMP.jl
Expand Up @@ -372,6 +372,12 @@ else
end
Base.isempty(::AbstractJuMPScalar) = false

# Check if two arrays of AbstractJuMPScalars are equal. Useful for testing.
function isequal_canonical(x::AbstractArray{<:JuMP.AbstractJuMPScalar},
y::AbstractArray{<:JuMP.AbstractJuMPScalar})
return size(x) == size(y) && all(JuMP.isequal_canonical.(x, y))
end

"""
AbstractShape
Expand Down
6 changes: 0 additions & 6 deletions test/runtests.jl
Expand Up @@ -22,12 +22,6 @@ const MOI = MathOptInterface
const MOIT = MOI.Test
const MOIU = MOI.Utilities

# TODO: This should be defined in JuMP source with the other versions of
# isequal_canonical.
function JuMP.isequal_canonical(x::AbstractArray{<:JuMP.AbstractJuMPScalar}, y::AbstractArray{<:JuMP.AbstractJuMPScalar})
size(x) == size(y) && all(JuMP.isequal_canonical.(x, y))
end

macro test_expression(expr)
esc(quote
@test JuMP.isequal_canonical(@expression(m, $expr), $expr)
Expand Down

0 comments on commit 92fd62e

Please sign in to comment.