From 757c97204aaae405855cb2aeb465a0c4a5f1a492 Mon Sep 17 00:00:00 2001 From: Joey Huchette Date: Tue, 25 Aug 2015 16:43:51 -0400 Subject: [PATCH] compatability fixes for v0.3 --- src/JuMP.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/JuMP.jl b/src/JuMP.jl index af369101d85..ab1642c8640 100644 --- a/src/JuMP.jl +++ b/src/JuMP.jl @@ -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 @@ -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 @@ -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.)