Skip to content

Commit

Permalink
💄 JuMPConstraint -> AbstractConstraint
Browse files Browse the repository at this point in the history
  • Loading branch information
IainNZ committed Apr 27, 2016
1 parent d49bba4 commit dd45077
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/JuMP.jl
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/affexpr.jl
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/norms.jl
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/quadexpr.jl
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sos.jl
Expand Up @@ -14,7 +14,7 @@
#############################################################################


type SOSConstraint <: JuMPConstraint
type SOSConstraint <: AbstractConstraint
terms::Vector{Variable}
weights::Vector{Float64}
sostype::Symbol
Expand Down

0 comments on commit dd45077

Please sign in to comment.