Skip to content

Commit

Permalink
compatability fixes for v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
joehuchette committed Aug 25, 2015
1 parent 078e125 commit 757c972
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type Model
colCat::Vector{Symbol}

# Variable cones of the form, e.g. (:SDP, 1:9)
varCones::Vector{Tuple{Symbol,Any}}
varCones::Vector{@compat Tuple{Symbol,Any}}

# Solution data
objVal
Expand Down Expand Up @@ -144,7 +144,7 @@ function Model(;solver=UnsetSolver())
Float64[], # colLower
Float64[], # colUpper
Symbol[], # colCat
Vector{Tuple{Symbol,Any}}[], # varCones
Vector{@compat Tuple{Symbol,Any}}[], # varCones
0, # objVal
Float64[], # colVal
Float64[], # redCosts
Expand Down Expand Up @@ -497,7 +497,9 @@ end
typealias AffExpr GenericAffExpr{Float64,Variable}

AffExpr() = zero(AffExpr)
# TODO: remove these when no longer supporting v0.3
AffExpr(x::Union(Number,Variable)) = convert(AffExpr, x)
AffExpr(x::AffExpr) = x

Base.isempty(a::AffExpr) = (length(a.vars) == 0 && a.constant == 0.)
Base.convert(::Type{AffExpr}, v::Variable) = AffExpr([v], [1.], 0.)
Expand Down

0 comments on commit 757c972

Please sign in to comment.