Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Test/intlinear.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ function int1test(model::MOI.ModelLike, config::TestConfig)
end
end

Base.isapprox(a::T, b::T; kwargs...) where T <: Union{MOI.SOS1, MOI.SOS2} = isapprox(a.weights, b.weights; kwargs...)

# sos from CPLEX.jl" begin
function int2test(model::MOI.ModelLike, config::TestConfig)
atol = config.atol
Expand Down
8 changes: 2 additions & 6 deletions src/sets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,6 @@ struct SOS1{T <: Real} <: AbstractVectorSet
weights::Vector{T}
end

Base.:(==)(a::SOS1{T}, b::SOS1{T}) where T = a.weights == b.weights
Base.isapprox(a::SOS1{T}, b::SOS1{T}; kwargs...) where T = isapprox(a.weights, b.weights; kwargs...)

"""
SOS2{T <: Real}(weights::Vector{T})

Expand All @@ -433,12 +430,11 @@ struct SOS2{T <: Real} <: AbstractVectorSet
weights::Vector{T}
end

Base.:(==)(a::SOS2{T}, b::SOS2{T}) where T = a.weights == b.weights
Base.isapprox(a::SOS2{T}, b::SOS2{T}; kwargs...) where T = isapprox(a.weights, b.weights; kwargs...)
Base.:(==)(a::T, b::T) where {T <: Union{SOS1, SOS2}} = a.weights == b.weights
Base.isapprox(a::T, b::T; kwargs...) where {T <: Union{SOS1, SOS2}} = isapprox(a.weights, b.weights; kwargs...)

dimension(s::Union{SOS1, SOS2}) = length(s.weights)


# isbits types, nothing to copy
function Base.copy(set::Union{Reals, Zeros, Nonnegatives, Nonpositives,
GreaterThan, LessThan, EqualTo, Interval,
Expand Down