diff --git a/REQUIRE b/REQUIRE index 137767a..7145386 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1,2 @@ julia 0.6 +Compat 0.63 diff --git a/src/HighLevelInterface/HighLevelInterface.jl b/src/HighLevelInterface/HighLevelInterface.jl index ddaad0a..696ae80 100644 --- a/src/HighLevelInterface/HighLevelInterface.jl +++ b/src/HighLevelInterface/HighLevelInterface.jl @@ -2,6 +2,7 @@ module HighLevelInterface using ..SolverInterface using ..MathProgBase +using Compat function warn_no_inf(T) if !(isinf(typemin(T)) && isinf(typemax(T))) diff --git a/src/HighLevelInterface/linprog.jl b/src/HighLevelInterface/linprog.jl index 53aec11..6497469 100644 --- a/src/HighLevelInterface/linprog.jl +++ b/src/HighLevelInterface/linprog.jl @@ -47,8 +47,8 @@ function buildlp(c::InputVector, A::AbstractMatrix, rowlb::InputVector, rowub::I rhs = rowubtmp @assert realtype <: Real - rowlb = Array{realtype}(nrow) - rowub = Array{realtype}(nrow) + rowlb = Array{realtype}(undef, nrow) + rowub = Array{realtype}(undef, nrow) for i in 1:nrow if sense[i] == '<' rowlb[i] = typemin(realtype) @@ -86,7 +86,7 @@ function solvelp(m) try attrs[:infeasibilityray] = getinfeasibilityray(m) catch - warn("Problem is infeasible, but infeasibility ray (\"Farkas proof\") is unavailable; check that the proper solver options are set.") + Compat.@warn("Problem is infeasible, but infeasibility ray (\"Farkas proof\") is unavailable; check that the proper solver options are set.") end return LinprogSolution(stat, nothing, [], attrs) elseif stat == :Unbounded @@ -94,7 +94,7 @@ function solvelp(m) try attrs[:unboundedray] = getunboundedray(m) catch - warn("Problem is unbounded, but unbounded ray is unavailable; check that the proper solver options are set.") + Compat.@warn("Problem is unbounded, but unbounded ray is unavailable; check that the proper solver options are set.") end return LinprogSolution(stat, nothing, [], attrs) else diff --git a/src/HighLevelInterface/mixintprog.jl b/src/HighLevelInterface/mixintprog.jl index c6ef48c..d370970 100644 --- a/src/HighLevelInterface/mixintprog.jl +++ b/src/HighLevelInterface/mixintprog.jl @@ -36,8 +36,8 @@ function mixintprog(c::InputVector, A::AbstractMatrix, rowlb::InputVector, rowub sense = rowlbtmp rhs = rowubtmp @assert realtype <: Real - rowlb = Array{realtype}(nrow) - rowub = Array{realtype}(nrow) + rowlb = Array{realtype}(undef, nrow) + rowub = Array{realtype}(undef, nrow) for i in 1:nrow if sense[i] == '<' rowlb[i] = typemin(realtype) diff --git a/src/SolverInterface/LinearQuadratic.jl b/src/SolverInterface/LinearQuadratic.jl index a2b62b6..0cec8bf 100644 --- a/src/SolverInterface/LinearQuadratic.jl +++ b/src/SolverInterface/LinearQuadratic.jl @@ -76,9 +76,9 @@ setquadobj!(m::AbstractLinearQuadraticModel,Q::Matrix) = setquadobj!(m,sparse(fl function setquadobj!(m::AbstractLinearQuadraticModel,Q::SparseMatrixCSC{Float64}) if issymmetric(Q) || istriu(Q) nnz_q = nnz(Q) - qr = Array{Cint}(nnz_q) - qc = Array{Cint}(nnz_q) - qv = Array{Cdouble}(nnz_q) + qr = Array{Cint}(undef, nnz_q) + qc = Array{Cint}(undef, nnz_q) + qv = Array{Cdouble}(undef, nnz_q) k = 0 colptr::Vector{Int} = Q.colptr nzval::Vector{Float64} = Q.nzval diff --git a/src/SolverInterface/SolverInterface.jl b/src/SolverInterface/SolverInterface.jl index 9c47e93..d15ac10 100644 --- a/src/SolverInterface/SolverInterface.jl +++ b/src/SolverInterface/SolverInterface.jl @@ -1,6 +1,9 @@ module SolverInterface using Base.Meta +using Compat +using Compat.SparseArrays +using Compat.LinearAlgebra const methods_by_tag = Dict{Symbol,Vector{Symbol}}() diff --git a/src/SolverInterface/lpqp_to_conic.jl b/src/SolverInterface/lpqp_to_conic.jl index 1617d7b..8193cf8 100644 --- a/src/SolverInterface/lpqp_to_conic.jl +++ b/src/SolverInterface/lpqp_to_conic.jl @@ -113,8 +113,8 @@ function loadproblem!(m::LPQPtoConicBridge, c, A, b, constr_cones, var_cones) # Linear constraint bounds - lb = Array{Float64}(length(linconstr_idx)) - ub = Array{Float64}(length(linconstr_idx)) + lb = Array{Float64}(undef, length(linconstr_idx)) + ub = Array{Float64}(undef, length(linconstr_idx)) k = 1 for (cone,idxs) in constr_cones if cone != :SOC && cone != :SOCRotated diff --git a/test/conicinterface.jl b/test/conicinterface.jl index 0429fb9..d98e818 100644 --- a/test/conicinterface.jl +++ b/test/conicinterface.jl @@ -5,7 +5,9 @@ # Test the MathProgBase.jl interface for a provided conic solver. ############################################################################# -using Base.Test +using Compat.Test +using Compat.LinearAlgebra +using Compat.SparseArrays using MathProgBase function coniclineartest(solver::MathProgBase.AbstractMathProgSolver;duals=false, tol=1e-6) diff --git a/test/linprog.jl b/test/linprog.jl index e9b04a0..6e9db39 100644 --- a/test/linprog.jl +++ b/test/linprog.jl @@ -1,4 +1,6 @@ -using Base.Test +using Compat.Test +using Compat.LinearAlgebra +using Compat.SparseArrays using MathProgBase function linprogtest(solver; objtol = 1e-7, primaltol = 1e-6) diff --git a/test/linproginterface.jl b/test/linproginterface.jl index 1a5976a..a0df5e3 100644 --- a/test/linproginterface.jl +++ b/test/linproginterface.jl @@ -1,5 +1,6 @@ -using Base.Test -using MathProgBase +using Compat.Test +using Compat.LinearAlgebra +#using MathProgBase using MathProgBase.SolverInterface function linprogsolvertest(solver::AbstractMathProgSolver, eps = Base.rtoldefault(Float64)) diff --git a/test/mixintprog.jl b/test/mixintprog.jl index f6c0dee..ea2adb3 100644 --- a/test/mixintprog.jl +++ b/test/mixintprog.jl @@ -1,4 +1,5 @@ -using Base.Test +using Compat.Test +using Compat.LinearAlgebra using MathProgBase function mixintprogtest(solver)