/QPSReader.jl

A reader for MPS and QPS files

Primary LanguageJuliaOtherNOASSERTION

QPSReader

Linux and macOS: Build Status Windows: Build Status Coverage Status codecov.io

A package to read linear optimization problems in fixed MPS format and quadratic optimization problems in QPS format.

The problems represented by the QPS format have the form

optimize   c₀ + cᵀ x + ½ xᵀ Q x    subject to   L ≤ Ax ≤ U and ℓ ≤ x ≤ u,

where "optimize" means either "minimize" or "maximize", c₀ ∈ ℝ is a constant term, c ∈ ℝⁿ is the linear term, Q = Qᵀ is the n×n positive semi-definite quadratic term, L is the vector of lower constraint bounds, A is the constraint matrix, U is the vector of upper constraint bounds, ℓ is the vector of lower bounds, and u is the vector of upper bounds.

Only continuous problems are supported at this time. Problems with binary, integer or semi-continuous variables are not supported.

This package exports the QPSData data type and the readqps() function. Because MPS is a subset of QPS, the readqps() function accepts both formats. Because the SIF is a superset of QPS, QPS problems implemented as SIF files (such as those from the Maros-Meszaros collection) are also supported.

Usage

julia> qp = readqps("Q25FV47.QPS")

The QPSData data type is defined as follows:

mutable struct QPSData
    nvar::Int                        # number of variables
    ncon::Int                        # number of constraints
    objsense::Symbol                 # :min, :max or :notset
    c0::Float64                      # constant term in objective
    c::Vector{Float64}               # linear term in objective
    Q::SparseMatrixCSC{Float64,Int}  # quadratic term in objective
    A::SparseMatrixCSC{Float64,Int}  # constraint matrix
    lcon::Vector{Float64}            # constraints lower bounds
    ucon::Vector{Float64}            # constraints upper bounds
    lvar::Vector{Float64}            # variables lower bounds
    uvar::Vector{Float64}            # variables upper bounds
    name::String                     # problem name
    objname::String                  # objective function name
    varnames::Vector{String}         # variable names, aka column names
    connames::Vector{String}         # constraint names, aka row names
end

The matrix Q is zero when reading an MPS file.

Problem Collections

References