From dd4507707601b23eeab2b4fa4867b5dd820ada99 Mon Sep 17 00:00:00 2001 From: Iain Dunning Date: Tue, 26 Apr 2016 20:43:13 -0400 Subject: [PATCH] :lipstick: JuMPConstraint -> AbstractConstraint --- src/JuMP.jl | 8 ++++---- src/affexpr.jl | 2 +- src/norms.jl | 2 +- src/quadexpr.jl | 2 +- src/sos.jl | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/JuMP.jl b/src/JuMP.jl index 8352b96ebec..a318b6d2d08 100644 --- a/src/JuMP.jl +++ b/src/JuMP.jl @@ -296,9 +296,9 @@ setprinthook(m::Model, f) = (m.printhook = f) ############################################################################# -# JuMPConstraint +# AbstractConstraint # Abstract base type for all constraint types -abstract JuMPConstraint +abstract AbstractConstraint # Abstract base type for all scalar types # In JuMP, used only for Variable. Useful primarily for extensions abstract AbstractJuMPScalar @@ -484,7 +484,7 @@ include("sos.jl") # ∑ cᵢ Xᵢ ≥ D, where D is a n×n symmetric data matrix, cᵢ are # scalars, and Xᵢ are n×n symmetric variable matrices. The inequality # is taken w.r.t. the psd partial order. -type SDConstraint <: JuMPConstraint +type SDConstraint <: AbstractConstraint terms end @@ -510,7 +510,7 @@ Base.copy(c::SDConstraint, new_model::Model) = ########################################################################## # ConstraintRef # Reference to a constraint for retrieving solution info -immutable ConstraintRef{M<:AbstractModel,T<:JuMPConstraint} +immutable ConstraintRef{M<:AbstractModel,T<:AbstractConstraint} m::M idx::Int end diff --git a/src/affexpr.jl b/src/affexpr.jl index 27ac33b7280..002bb4cd851 100644 --- a/src/affexpr.jl +++ b/src/affexpr.jl @@ -116,7 +116,7 @@ end # GenericRangeConstraint # l ≤ ∑ aᵢ xᵢ ≤ u # The constant part of the internal expression is assumed to be zero -type GenericRangeConstraint{TermsType} <: JuMPConstraint +type GenericRangeConstraint{TermsType} <: AbstractConstraint terms::TermsType lb::Float64 ub::Float64 diff --git a/src/norms.jl b/src/norms.jl index a22cb1cd473..1e1b1c11ab1 100644 --- a/src/norms.jl +++ b/src/norms.jl @@ -101,7 +101,7 @@ getvalue(n::GenericNormExpr) = n.coeff * getvalue(n.norm) + getvalue(n.aff) # GenericSOCConstraint # Second-order cone constraint of form # α||Ax-b||₂ + cᵀx + d ≤ 0 -type GenericSOCConstraint{T<:GenericSOCExpr} <: JuMPConstraint +type GenericSOCConstraint{T<:GenericSOCExpr} <: AbstractConstraint normexpr::T function GenericSOCConstraint{T}(normexpr::T) if normexpr.coeff < 0 diff --git a/src/quadexpr.jl b/src/quadexpr.jl index df43ca5d4f9..982878a514d 100644 --- a/src/quadexpr.jl +++ b/src/quadexpr.jl @@ -103,7 +103,7 @@ getvalue(arr::Array{QuadExpr}) = map(getvalue, arr) # GenericQuadConstraint # ∑qᵢⱼ xᵢⱼ + ∑ aᵢ xᵢ + c [≤,≥] 0 # As RHS is implicitly taken to be zero, we store only LHS and sense -type GenericQuadConstraint{QuadType} <: JuMPConstraint +type GenericQuadConstraint{QuadType} <: AbstractConstraint terms::QuadType sense::Symbol end diff --git a/src/sos.jl b/src/sos.jl index 6c3754d4ab6..a97c8abf961 100644 --- a/src/sos.jl +++ b/src/sos.jl @@ -14,7 +14,7 @@ ############################################################################# -type SOSConstraint <: JuMPConstraint +type SOSConstraint <: AbstractConstraint terms::Vector{Variable} weights::Vector{Float64} sostype::Symbol