diff --git a/.travis.yml b/.travis.yml index 44761ddc4..57f4b9b3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ os: - linux - osx julia: - - 0.3 - 0.4 - nightly notifications: diff --git a/REQUIRE b/REQUIRE index 8360b9558..87f4eb05d 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,4 +1,3 @@ -julia 0.3 +julia 0.4 MathProgBase 0.3.8 -Compat 0.4.4 DataStructures diff --git a/src/Convex.jl b/src/Convex.jl index 92bc1cfb2..870ad9d6b 100644 --- a/src/Convex.jl +++ b/src/Convex.jl @@ -1,5 +1,4 @@ module Convex -using Compat import DataStructures importall Base.Operators diff --git a/src/atoms/abs.jl b/src/atoms/abs.jl index ebe871976..b54b24cb1 100644 --- a/src/atoms/abs.jl +++ b/src/atoms/abs.jl @@ -14,8 +14,8 @@ export sign, curvature, monotonicity, evaluate type AbsAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function AbsAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/affine/add_subtract.jl b/src/atoms/affine/add_subtract.jl index 354c65c13..8660247fc 100644 --- a/src/atoms/affine/add_subtract.jl +++ b/src/atoms/affine/add_subtract.jl @@ -15,8 +15,8 @@ export sign, curvature, monotonicity, evaluate type NegateAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function NegateAtom(x::AbstractExpr) children = (x,) @@ -57,7 +57,7 @@ type AdditionAtom <: AbstractExpr head::Symbol id_hash::UInt64 children::Array{AbstractExpr, 1} - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} function AdditionAtom(x::AbstractExpr, y::AbstractExpr) # find the size of the expression = max of size of x and size of y diff --git a/src/atoms/affine/diag.jl b/src/atoms/affine/diag.jl index 5ab8c5d98..5016e198d 100644 --- a/src/atoms/affine/diag.jl +++ b/src/atoms/affine/diag.jl @@ -13,8 +13,8 @@ export diag type DiagAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} k::Int function DiagAtom(x::AbstractExpr, k::Int=0) diff --git a/src/atoms/affine/diagm.jl b/src/atoms/affine/diagm.jl index 0c6ac9d09..8852f6fa7 100644 --- a/src/atoms/affine/diagm.jl +++ b/src/atoms/affine/diagm.jl @@ -11,8 +11,8 @@ export diagm type DiagMatrixAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function DiagMatrixAtom(x::AbstractExpr) (num_rows, num_cols) = x.size diff --git a/src/atoms/affine/index.jl b/src/atoms/affine/index.jl index 726342f85..c82511c18 100644 --- a/src/atoms/affine/index.jl +++ b/src/atoms/affine/index.jl @@ -1,13 +1,13 @@ import Base: getindex, to_index export IndexAtom, getindex -@compat typealias ArrayOrNothing Union{AbstractArray, Void} +typealias ArrayOrNothing Union{AbstractArray, Void} type IndexAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} rows::ArrayOrNothing cols::ArrayOrNothing inds::ArrayOrNothing diff --git a/src/atoms/affine/multiply_divide.jl b/src/atoms/affine/multiply_divide.jl index 949f1d75c..ae839ac6f 100644 --- a/src/atoms/affine/multiply_divide.jl +++ b/src/atoms/affine/multiply_divide.jl @@ -15,8 +15,8 @@ export sign, monotonicity, curvature, evaluate, conic_form! type MultiplyAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function MultiplyAtom(x::AbstractExpr, y::AbstractExpr) if x.size == (1, 1) @@ -109,8 +109,8 @@ end type DotMultiplyAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{Constant, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{Constant, AbstractExpr} + size::Tuple{Int, Int} function DotMultiplyAtom(x::Constant, y::AbstractExpr) if x.size != y.size @@ -157,4 +157,4 @@ end .*(x::AbstractExpr, y::AbstractExpr) = .*(x, y) .*(x::Value, y::AbstractExpr) = .*(Constant(x), y) .*(x::AbstractExpr, y::Value) = .*(Constant(y), x) -./(x::AbstractExpr, y::Value) = .*(1./y, x) \ No newline at end of file +./(x::AbstractExpr, y::Value) = .*(1./y, x) diff --git a/src/atoms/affine/reshape.jl b/src/atoms/affine/reshape.jl index f026e59ca..c4f4d1544 100644 --- a/src/atoms/affine/reshape.jl +++ b/src/atoms/affine/reshape.jl @@ -6,8 +6,8 @@ export sign, curvature, monotonicity, evaluate, conic_form! type ReshapeAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function ReshapeAtom(x::AbstractExpr, m::Int, n::Int) if m * n != get_vectorized_size(x) diff --git a/src/atoms/affine/stack.jl b/src/atoms/affine/stack.jl index c352ed596..efb57c09b 100644 --- a/src/atoms/affine/stack.jl +++ b/src/atoms/affine/stack.jl @@ -6,7 +6,7 @@ type HcatAtom <: AbstractExpr head::Symbol id_hash::UInt64 children::Tuple - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} function HcatAtom(args::AbstractExpr...) num_rows = args[1].size[1] diff --git a/src/atoms/affine/sum.jl b/src/atoms/affine/sum.jl index bda2e4e0b..699c2214c 100644 --- a/src/atoms/affine/sum.jl +++ b/src/atoms/affine/sum.jl @@ -12,8 +12,8 @@ export sum type SumAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function SumAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/affine/transpose.jl b/src/atoms/affine/transpose.jl index a262bff8e..b84ebc5df 100644 --- a/src/atoms/affine/transpose.jl +++ b/src/atoms/affine/transpose.jl @@ -12,8 +12,8 @@ export sign, curvature, monotonicity, evaluate, conic_form! type TransposeAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function TransposeAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/dotsort.jl b/src/atoms/dotsort.jl index 2a7789a14..9a33e7323 100644 --- a/src/atoms/dotsort.jl +++ b/src/atoms/dotsort.jl @@ -13,8 +13,8 @@ export sign, curvature, monotonicity, evaluate type DotSortAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} w::Value function DotSortAtom(x::AbstractExpr, w::Value) diff --git a/src/atoms/exp_cone/entropy.jl b/src/atoms/exp_cone/entropy.jl index 865a8da15..fb941ac6c 100644 --- a/src/atoms/exp_cone/entropy.jl +++ b/src/atoms/exp_cone/entropy.jl @@ -16,8 +16,8 @@ export sign, curvature, monotonicity, evaluate type EntropyAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function EntropyAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/exp_cone/exp.jl b/src/atoms/exp_cone/exp.jl index 00042d22c..b7407ddf4 100644 --- a/src/atoms/exp_cone/exp.jl +++ b/src/atoms/exp_cone/exp.jl @@ -14,8 +14,8 @@ export sign, curvature, monotonicity, evaluate type ExpAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function ExpAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/exp_cone/log.jl b/src/atoms/exp_cone/log.jl index 718f49662..cdc104409 100644 --- a/src/atoms/exp_cone/log.jl +++ b/src/atoms/exp_cone/log.jl @@ -14,8 +14,8 @@ export sign, curvature, monotonicity, evaluate type LogAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function LogAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/exp_cone/logsumexp.jl b/src/atoms/exp_cone/logsumexp.jl index 49c450b89..c8ac010a8 100644 --- a/src/atoms/exp_cone/logsumexp.jl +++ b/src/atoms/exp_cone/logsumexp.jl @@ -15,8 +15,8 @@ export sign, curvature, monotonicity, evaluate type LogSumExpAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function LogSumExpAtom(x::AbstractExpr) children = (x,) @@ -63,4 +63,4 @@ function logisticloss(e::AbstractExpr) s += logsumexp([e[i], 0]) end return s -end \ No newline at end of file +end diff --git a/src/atoms/exp_cone/relative_entropy.jl b/src/atoms/exp_cone/relative_entropy.jl index ee7a71770..2e9340d4f 100644 --- a/src/atoms/exp_cone/relative_entropy.jl +++ b/src/atoms/exp_cone/relative_entropy.jl @@ -13,8 +13,8 @@ export sign, curvature, monotonicity, evaluate type RelativeEntropyAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr,AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr,AbstractExpr} + size::Tuple{Int, Int} function RelativeEntropyAtom(x::AbstractExpr, y::AbstractExpr) children = (x, y) diff --git a/src/atoms/huber.jl b/src/atoms/huber.jl index 7f7dd6c7d..be1decd12 100644 --- a/src/atoms/huber.jl +++ b/src/atoms/huber.jl @@ -3,8 +3,8 @@ export huber type HuberAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} M::Real function HuberAtom(x::AbstractExpr, M::Real) diff --git a/src/atoms/logdet.jl b/src/atoms/logdet.jl index dd2cf02ed..bde1c2f29 100644 --- a/src/atoms/logdet.jl +++ b/src/atoms/logdet.jl @@ -3,8 +3,8 @@ import Base.logdet type LogDetAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function LogDetAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/max.jl b/src/atoms/max.jl index 3c76a963e..1418e3238 100644 --- a/src/atoms/max.jl +++ b/src/atoms/max.jl @@ -12,8 +12,8 @@ export max, pos, hinge_loss type MaxAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function MaxAtom(x::AbstractExpr, y::AbstractExpr) if x.size == y.size diff --git a/src/atoms/maximum.jl b/src/atoms/maximum.jl index 6ede10610..f82733b57 100644 --- a/src/atoms/maximum.jl +++ b/src/atoms/maximum.jl @@ -11,8 +11,8 @@ export maximum type MaximumAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function MaximumAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/min.jl b/src/atoms/min.jl index 20f5e5407..ebc725864 100644 --- a/src/atoms/min.jl +++ b/src/atoms/min.jl @@ -12,8 +12,8 @@ export min, neg type MinAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function MinAtom(x::AbstractExpr, y::AbstractExpr) if x.size == y.size diff --git a/src/atoms/minimum.jl b/src/atoms/minimum.jl index 597896c93..8ca08da91 100644 --- a/src/atoms/minimum.jl +++ b/src/atoms/minimum.jl @@ -11,8 +11,8 @@ export minimum type MinimumAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function MinimumAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/sdp_cone/lambda_min_max.jl b/src/atoms/sdp_cone/lambda_min_max.jl index c366c0dcd..eb1b7c049 100644 --- a/src/atoms/sdp_cone/lambda_min_max.jl +++ b/src/atoms/sdp_cone/lambda_min_max.jl @@ -12,8 +12,8 @@ export lambdamax, lambdamin type LambdaMaxAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function LambdaMaxAtom(x::AbstractExpr) children = (x,) @@ -65,8 +65,8 @@ end type LambdaMinAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function LambdaMinAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/sdp_cone/matrixfrac.jl b/src/atoms/sdp_cone/matrixfrac.jl index f97ad8ee2..559979079 100644 --- a/src/atoms/sdp_cone/matrixfrac.jl +++ b/src/atoms/sdp_cone/matrixfrac.jl @@ -10,8 +10,8 @@ export matrixfrac type MatrixFracAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function MatrixFracAtom(x::AbstractExpr, P::AbstractExpr) if x.size[2] != 1 diff --git a/src/atoms/sdp_cone/nuclearnorm.jl b/src/atoms/sdp_cone/nuclearnorm.jl index 4fc573e75..b09276d0b 100644 --- a/src/atoms/sdp_cone/nuclearnorm.jl +++ b/src/atoms/sdp_cone/nuclearnorm.jl @@ -11,8 +11,8 @@ export nuclearnorm type NuclearNormAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function NuclearNormAtom(x::AbstractExpr) children = (x,) @@ -55,4 +55,4 @@ function conic_form!(x::NuclearNormAtom, unique_conic_forms) cache_conic_form!(unique_conic_forms, x, p) end return get_conic_form(unique_conic_forms, x) -end \ No newline at end of file +end diff --git a/src/atoms/sdp_cone/operatornorm.jl b/src/atoms/sdp_cone/operatornorm.jl index 4641ef27f..0703a37c2 100644 --- a/src/atoms/sdp_cone/operatornorm.jl +++ b/src/atoms/sdp_cone/operatornorm.jl @@ -12,8 +12,8 @@ export operatornorm, sigmamax type OperatorNormAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function OperatorNormAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/sdp_cone/sumlargesteigs.jl b/src/atoms/sdp_cone/sumlargesteigs.jl index eaf39f3c8..51483c746 100644 --- a/src/atoms/sdp_cone/sumlargesteigs.jl +++ b/src/atoms/sdp_cone/sumlargesteigs.jl @@ -13,8 +13,8 @@ export sumlargesteigs type SumLargestEigs <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function SumLargestEigs(x::AbstractExpr, k::AbstractExpr) children = (x, k) diff --git a/src/atoms/second_order_cone/geomean.jl b/src/atoms/second_order_cone/geomean.jl index 2f4b42941..8ee1ee0f6 100644 --- a/src/atoms/second_order_cone/geomean.jl +++ b/src/atoms/second_order_cone/geomean.jl @@ -5,8 +5,8 @@ export sign, monotonicity, curvature, conic_form! type GeoMeanAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function GeoMeanAtom(x::AbstractExpr, y::AbstractExpr) if x.size != y.size diff --git a/src/atoms/second_order_cone/norm2.jl b/src/atoms/second_order_cone/norm2.jl index 8f4caffb7..823463211 100644 --- a/src/atoms/second_order_cone/norm2.jl +++ b/src/atoms/second_order_cone/norm2.jl @@ -12,8 +12,8 @@ export sign, monotonicity, curvature, conic_form! type EucNormAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} function EucNormAtom(x::AbstractExpr) children = (x,) diff --git a/src/atoms/second_order_cone/qol_elementwise.jl b/src/atoms/second_order_cone/qol_elementwise.jl index 44f1dd569..5e2ee9116 100644 --- a/src/atoms/second_order_cone/qol_elementwise.jl +++ b/src/atoms/second_order_cone/qol_elementwise.jl @@ -4,8 +4,8 @@ export sign, monotonicity, curvature, conic_form! type QolElemAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function QolElemAtom(x::AbstractExpr, y::AbstractExpr) if x.size != y.size diff --git a/src/atoms/second_order_cone/quadoverlin.jl b/src/atoms/second_order_cone/quadoverlin.jl index 8c4fd88e3..367314f38 100644 --- a/src/atoms/second_order_cone/quadoverlin.jl +++ b/src/atoms/second_order_cone/quadoverlin.jl @@ -4,8 +4,8 @@ export sign, monotonicity, curvature, conic_form! type QuadOverLinAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr} + size::Tuple{Int, Int} function QuadOverLinAtom(x::AbstractExpr, y::AbstractExpr) if x.size[2] != 1 && y.size != (1, 1) diff --git a/src/atoms/second_order_cone/rationalnorm.jl b/src/atoms/second_order_cone/rationalnorm.jl index 242ba33d0..d79520f5b 100644 --- a/src/atoms/second_order_cone/rationalnorm.jl +++ b/src/atoms/second_order_cone/rationalnorm.jl @@ -18,8 +18,8 @@ export rationalnorm type RationalNormAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} k::Rational{Int64} function RationalNormAtom(x::AbstractExpr, k::Rational{Int64}) diff --git a/src/atoms/sumlargest.jl b/src/atoms/sumlargest.jl index fb28ec945..e38e6e71b 100644 --- a/src/atoms/sumlargest.jl +++ b/src/atoms/sumlargest.jl @@ -11,8 +11,8 @@ export sign, curvature, monotonicity, evaluate type SumLargestAtom <: AbstractExpr head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr} - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr} + size::Tuple{Int, Int} k::Int function SumLargestAtom(x::AbstractExpr, k::Int) diff --git a/src/conic_form.jl b/src/conic_form.jl index c531d1d62..91e186b83 100644 --- a/src/conic_form.jl +++ b/src/conic_form.jl @@ -63,8 +63,8 @@ type ConicConstr sizes::Array{Int} end -UniqueExpMap = DataStructures.OrderedDict{@compat(Tuple{Symbol, UInt64}), ConicObj} -UniqueConstrMap = DataStructures.OrderedDict{@compat(Tuple{Symbol, UInt64}), Int} +UniqueExpMap = DataStructures.OrderedDict{Tuple{Symbol, UInt64}, ConicObj} +UniqueConstrMap = DataStructures.OrderedDict{Tuple{Symbol, UInt64}, Int} UniqueConstrList = Array{ConicConstr} type UniqueConicForms diff --git a/src/constant.jl b/src/constant.jl index 00eb61d2b..9496cc6ac 100644 --- a/src/constant.jl +++ b/src/constant.jl @@ -9,7 +9,7 @@ type Constant <: AbstractExpr head::Symbol id_hash::UInt64 value::Value - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} vexity::Vexity sign::Sign diff --git a/src/constraints/constraints.jl b/src/constraints/constraints.jl index 190b99f8b..f745ba1a2 100644 --- a/src/constraints/constraints.jl +++ b/src/constraints/constraints.jl @@ -10,7 +10,7 @@ type EqConstraint <: Constraint id_hash::UInt64 lhs::AbstractExpr rhs::AbstractExpr - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} dual::ValueOrNothing function EqConstraint(lhs::AbstractExpr, rhs::AbstractExpr) @@ -57,7 +57,7 @@ type LtConstraint <: Constraint id_hash::UInt64 lhs::AbstractExpr rhs::AbstractExpr - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} dual::ValueOrNothing function LtConstraint(lhs::AbstractExpr, rhs::AbstractExpr) @@ -105,7 +105,7 @@ type GtConstraint <: Constraint id_hash::UInt64 lhs::AbstractExpr rhs::AbstractExpr - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} dual::ValueOrNothing function GtConstraint(lhs::AbstractExpr, rhs::AbstractExpr) diff --git a/src/constraints/exp_constraints.jl b/src/constraints/exp_constraints.jl index cec136bc9..5fb5f2c80 100644 --- a/src/constraints/exp_constraints.jl +++ b/src/constraints/exp_constraints.jl @@ -4,8 +4,8 @@ export ExpConstraint, conic_form!, vexity type ExpConstraint <: Constraint head::Symbol id_hash::UInt64 - children::@compat Tuple{AbstractExpr, AbstractExpr, AbstractExpr} # (x, y, z) - size::@compat Tuple{Int, Int} + children::Tuple{AbstractExpr, AbstractExpr, AbstractExpr} # (x, y, z) + size::Tuple{Int, Int} dual::ValueOrNothing function ExpConstraint(x::AbstractExpr, y::AbstractExpr, z::AbstractExpr) diff --git a/src/constraints/sdp_constraints.jl b/src/constraints/sdp_constraints.jl index dca76a92a..eae70a94b 100644 --- a/src/constraints/sdp_constraints.jl +++ b/src/constraints/sdp_constraints.jl @@ -8,7 +8,7 @@ type SDPConstraint <: Constraint head::Symbol id_hash::UInt64 child::AbstractExpr - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} dual::ValueOrNothing function SDPConstraint(child::AbstractExpr) diff --git a/src/expressions.jl b/src/expressions.jl index 95f83e305..afe919ea1 100644 --- a/src/expressions.jl +++ b/src/expressions.jl @@ -97,9 +97,9 @@ function length(x::AbstractExpr) end ### User-defined Unions -@compat typealias Value Union{Number, AbstractArray} -@compat typealias ValueOrNothing Union{Value, Void} -@compat typealias AbstractExprOrValue Union{AbstractExpr, Value} +typealias Value Union{Number, AbstractArray} +typealias ValueOrNothing Union{Value, Void} +typealias AbstractExprOrValue Union{AbstractExpr, Value} convert(::Type{AbstractExpr}, x::Value) = Constant(x) convert(::Type{AbstractExpr}, x::AbstractExpr) = x diff --git a/src/problems.jl b/src/problems.jl index c8a7241fb..8ea001b28 100644 --- a/src/problems.jl +++ b/src/problems.jl @@ -4,7 +4,7 @@ export Problem, Solution, minimize, maximize, satisfy, add_constraint!, add_cons export Float64OrNothing export conic_problem -@compat typealias Float64OrNothing Union{Float64, Void} +typealias Float64OrNothing Union{Float64, Void} # TODO: Cleanup type Solution{T<:Number} @@ -47,7 +47,7 @@ end function find_variable_ranges(constraints) index = 0 constr_size = 0 - var_to_ranges = Dict{UInt64, @compat Tuple{Int, Int}}() + var_to_ranges = Dict{UInt64, Tuple{Int, Int}}() for constraint in constraints for i = 1:length(constraint.objs) for (id, val) in constraint.objs[i] @@ -111,7 +111,7 @@ function conic_problem(p::Problem) A = spzeros(constr_size, var_size) b = spzeros(constr_size, 1) - cones = (@compat Tuple{Symbol, UnitRange{Int}})[] + cones = Tuple{Symbol, UnitRange{Int}}[] constr_index = 0 for constraint in constraints total_constraint_size = 0 diff --git a/src/solution.jl b/src/solution.jl index f6d1a4ad7..28cb8f873 100644 --- a/src/solution.jl +++ b/src/solution.jl @@ -121,7 +121,7 @@ function populate_solution!(m::MathProgBase.AbstractMathProgModel, problem end -function populate_variables!(problem::Problem, var_to_ranges::Dict{UInt64, @compat Tuple{Int, Int}}) +function populate_variables!(problem::Problem, var_to_ranges::Dict{UInt64, Tuple{Int, Int}}) x = problem.solution.primal for (id, (start_index, end_index)) in var_to_ranges var = id_to_variables[id] @@ -138,7 +138,7 @@ end # TODO: it would be super cool to grab the other expressions that appear in the primal solution vector, # get their `expression_to_range`, # and populate them too using `evaluate` -@compat function load_primal_solution!(primal::Array{Float64,1}, var_to_ranges::Dict{UInt64, Tuple{Int, Int}}) +function load_primal_solution!(primal::Array{Float64,1}, var_to_ranges::Dict{UInt64, Tuple{Int, Int}}) for (id, (start_index, end_index)) in var_to_ranges var = id_to_variables[id] if var.value != nothing diff --git a/src/variable.jl b/src/variable.jl index 27d7daa05..5140da1de 100644 --- a/src/variable.jl +++ b/src/variable.jl @@ -10,12 +10,12 @@ type Variable <: AbstractExpr head::Symbol id_hash::UInt64 value::ValueOrNothing - size::@compat Tuple{Int, Int} + size::Tuple{Int, Int} vexity::Vexity sign::Sign sets::Array{Symbol,1} - function Variable(size::@compat(Tuple{Int, Int}), sign::Sign=NoSign(), sets::Symbol...) + function Variable(size::Tuple{Int, Int}, sign::Sign=NoSign(), sets::Symbol...) this = new(:variable, 0, nothing, size, AffineVexity(), sign, Symbol[sets...]) this.id_hash = object_id(this) id_to_variables[this.id_hash] = this @@ -25,7 +25,7 @@ type Variable <: AbstractExpr Variable(m::Int, n::Int, sign::Sign=NoSign(), sets::Symbol...) = Variable((m,n), sign, sets...) Variable(sign::Sign, sets::Symbol...) = Variable((1, 1), sign, sets...) Variable(sets::Symbol...) = Variable((1, 1), NoSign(), sets...) - Variable(size::@compat(Tuple{Int, Int}), sets::Symbol...) = Variable(size, NoSign(), sets...) + Variable(size::Tuple{Int, Int}, sets::Symbol...) = Variable(size, NoSign(), sets...) Variable(size::Int, sign::Sign=NoSign(), sets::Symbol...) = Variable((size, 1), sign, sets...) Variable(size::Int, sets::Symbol...) = Variable((size, 1), sets...) end @@ -101,4 +101,4 @@ function free!(x::Variable) x.sets[end] == :fixed && pop!(x.sets) x.vexity = AffineVexity() x -end \ No newline at end of file +end