#linear-programming #parser #file-format #optimization #solver #pest-parser

bin+lib lp_parser_rs

A Rust parser for the LP file format

21 releases (12 stable)

new 1.3.2 Nov 19, 2024
1.2.5 Oct 29, 2024
1.2.4 Apr 29, 2024
1.2.0 Mar 14, 2024
0.1.3 Nov 14, 2023

#528 in Math

Download history 147/week @ 2024-07-30 2/week @ 2024-09-17 43/week @ 2024-09-24 137/week @ 2024-10-29 8/week @ 2024-11-05 90/week @ 2024-11-12

245 downloads per month

MIT/Apache

1MB
729 lines

LP File Parser

Cargo Test Crates.io Documentation

Overview

Logo

A custom Rust LP file parser - this crate leverages the PEST crate for parsing LP files. It is designed and adhering to the following specifications:

Try it out using the following command line;

git clone https://github.com/dandxy89/lp_parser_rs.git &&
    cargo run -- {{PATH_TO_FILE}}

Supported LP Specifications

  • Problem Name
  • Problem Sense
  • Objectives
    • Single-Objective Case
    • Multi-Objective Case
  • Constraints
  • Bounds
  • Variable Types: Integer, Generals, Lower Bounded, Upper Bounded, Free & Upper and Lower Bounded
  • Semi-continuous
  • Special Order Sets (SOS)

Crate Features

  • serde: Adds Serde annotations to each of the model Structs and Enums.
  • diff: Adds capability to diff two Structs

Acknowledgments

Test data has been copied from other similar or related projects:

Testers and Contributors

This crate utilized insta for snapshot testing.

cargo insta test --all-features # Run all tests
cargo insta review # Review any changes to the snapshots

Dependencies