cuOpt MPS Parser API Reference¶
MPS Parser¶
Reads the equation from the input text file which is MPS formatted
Notes¶
Read this link http://lpsolve.sourceforge.net/5.5/mps-format.htm for more details on both free and fixed MPS format.
Parameters¶
- mps_file_pathstr
Path to MPS formatted file
- fixed_mps_formatbool
If MPS file should be parsed as fixed, false by default
Returns¶
- data_model: DataModel
A fully formed LP problem which represents the given MPS file
Examples¶
>>> from cuopt import linear_programming
>>>
>>> data_model = linear_programming.ParseMps(mps_file_path)
>>>
>>> # Build a solver setting object & lower the accuracy from 1e-4 to 1e-2
>>> solver_settings = linear_programming.SolverSettings()
>>> solver_settings.set_optimality_tolerance(1e-2)
>>>
>>> # Call solve
>>> solution = linear_programming.Solve(data_model, solver_settings)
>>>
>>> # Print solution
>>> print(solution.get_primal_solution())