Giter Club home page Giter Club logo

Comments (5)

mtanneau avatar mtanneau commented on May 24, 2024

The reader errors because these files are in fixed MPS format, but Free MPS is used by default.

Notably, these files have row/column names that contain spaces (including IIRC some fieldnames that are just empty).

You need to pass mpsformat = :fixed to force the use of Fixed MPS:

using QPSReader
netlib_path = fetch_netlib()
blend = readqps(joinpath(netlib_path, "BLEND.SIF"), mpsformat=:fixed)

This resolves the errors on the five instances above

julia> blend = readqps(joinpath(netlib_path, "BLEND.SIF"), mpsformat=:fixed);
[ Info: Using 'BLEND' as NAME (l. 5)
[ Info: Using 'C' as objective (l. 98)
[ Info: Using '' as RHS (l. 376)

julia> prob = readqps(joinpath(netlib_path, "DFL001.SIF"), mpsformat=:fixed);
[ Info: Using 'DFL001' as NAME (l. 5)
[ Info: Using 'NIL' as objective (l. 6098)
[ Info: Using '' as RHS (l. 29101)
[ Info: Using '' as BOUNDS (l. 29934)

julia> prob = readqps(joinpath(netlib_path, "FORPLAN.SIF"), mpsformat=:fixed)
[ Info: Using 'FORPLAN' as NAME (l. 5)
[ Info: Using 'OB1PNW20' as objective (l. 21)
[ Info: Using 'RHS 1' as RHS (l. 2733)
[ Info: Using 'RNG 1' as RANGES (l. 2742)
[ Info: Using 'BND-1' as BOUNDS (l. 2744)

julia> prob = readqps(joinpath(netlib_path, "GFRD-PNC.SIF"), mpsformat=:fixed);
[ Info: Using 'GFRD-PNC' as NAME (l. 5)
[ Info: Using 'OBJ' as objective (l. 20)
[ Info: Using '' as RHS (l. 2821)
[ Info: Using '' as BOUNDS (l. 2856)

julia> prob = readqps(joinpath(netlib_path, "SIERRA.SIF"), mpsformat=:fixed);
[ Info: Using 'SIERRA' as NAME (l. 5)
[ Info: Using 'OBJ' as objective (l. 1247)
[ Info: Using '' as RHS (l. 6566)
[ Info: Using '' as BOUNDS (l. 6958)

from qpsreader.jl.

dpo avatar dpo commented on May 24, 2024

Ah, I see. Thank you. Maybe the reader could print a message in case of error saying something like "try reading the file with mpsformat=:fixed".

from qpsreader.jl.

mtanneau avatar mtanneau commented on May 24, 2024

print a message in case of error

I am not 100% in favour of doing that, mainly because there is virtually no way of telling whether an error is due to fixed vs free format, or something else. For instance, in the above example, out of 5 instances, three different errors were encountered.
For what it's worth, Mosek and CPLEX also error when reading those files.

We should however add a line in the README (e.g., in "Usage") to show how one can select the MPS format, and maybe underline the difference between fixed & free format.

from qpsreader.jl.

dpo avatar dpo commented on May 24, 2024

Sounds good.

from qpsreader.jl.

mtanneau avatar mtanneau commented on May 24, 2024

Closed by #27

from qpsreader.jl.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.