Documentation

mps

A fast MPS parser written in Rust

ci docs.rs dependency status license: MIT codecov Docker Image Size (tag) FlakeHub Minimum Stable Rust Version

About

mps is a parser for the Mathematical Programming System (MPS) file format, commonly used to represent optimization problems.

This crate provides both a library and a CLI for parsing MPS data. Key features include:

  • Configurable Parsing:
    • Supported feature flags:
      • trace - Enhanced debugging and statistics via nom_tracable and nom_locate.
      • proptest - Property testing integrations.
      • cli - Command line interface.
  • Robustness: Extensively tested against Netlib LP test suite.
  • Performance: Benchmarked using Criterion.rs.

Examples

Library

use mps::Parser;

let contents = "MPS data...";
match Parser::<f32>::parse(&contents) {
    Ok((_, model)) => { /* use MPS model */ },
    Err(e) => eprintln!("Parsing error: {}", e),
}

CLI

$ mps --input-path ./data/netlib/afiro

Usage as a flake

Add mps to your flake.nix:

{
  inputs.mps.url = "https://flakehub.com/f/integrated-reasoning/mps/*.tar.gz";

  outputs = { self, mps }: {
    # Use in your outputs
  };
}

Running with Docker

docker run -it integratedreasoning/mps:latest