1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! # mps
//!
//! `mps` is a parser for the Mathematical Programming System (MPS) file format,
//! commonly used to represent optimization problems.
//!
//! ## Examples
//!
//! **Library**
//!
//! ```
//! use mps::Parser;
//!
//! let data = "
//! NAME example
//! ROWS
//! N OBJ
//! L R1
//! L R2
//! E R3
//! COLUMNS
//! X1 OBJ -6
//! X1 R1 2
//! X1 R2 1
//! X1 R3 3
//! X2 OBJ 7
//! X2 R1 5
//! X2 R2 -1
//! X2 R3 2
//! X3 OBJ 4
//! X3 R1 -1
//! X3 R2 -2
//! X3 R3 2
//! RHS
//! RHS1 R1 18
//! RHS1 R2 -14
//! RHS1 R3 26
//! BOUNDS
//! LO BND1 X1 0
//! LO BND1 X2 0
//! LO BND1 X3 0
//! ENDATA";
//!
//! Parser::<f32>::parse(data);
//! ```
//!
//! **CLI**
//!
//! ```bash
//! $ mps --input-path ./data/netlib/afiro
//! ```
//!
//! This crate provides both a library and a CLI for parsing MPS data. Key features include:
//!
//! - **Configurable Parsing**:
//! - Supported feature flags:
//! - `cli` - Command line interface.
//! - `trace` - Enhanced debugging and statistics via `nom_tracable` and `nom_locate`.
//! - **Robustness**: Extensively tested against [Netlib LP test suite](http://www.netlib.org/lp/data/).
//! - **Performance**: Benchmarked using [Criterion.rs](https://github.com/bheisler/criterion.rs).
//!
//! ## References
//!
//! - [Mathematical Programming System format](https://lpsolve.sourceforge.net/5.5/mps-format.htm)
//! - [NETLIB linear programming library](http://www.netlib.org/lp/)
//!
pub use crateParser;