pub struct MpsFile {
pub problem_name: String,
pub variables: HashMap<String, Variable>,
pub problem: Problem,
}Expand description
A linear programming problem parsed from an MPS file.
Fields§
§problem_name: StringValue of the NAME field.
variables: HashMap<String, Variable>A mapping of a variable name to the corresponding Variable.
problem: ProblemA parsed problem.
Implementations§
Source§impl MpsFile
impl MpsFile
Sourcepub fn parse<R: BufRead>(
input: R,
direction: OptimizationDirection,
) -> Result<Self>
pub fn parse<R: BufRead>( input: R, direction: OptimizationDirection, ) -> Result<Self>
Parses a linear programming problem from an MPS file.
This function supports the “free” MPS format, meaning that lines are tokenized based on whitespace, not based on position. Also, because MPS lacks any way to indicate the optimization direction, you have to supply it manually.
§Errors
Apart from I/O errors coming from input, this function will signal any syntax error
as std::io::Error with the kind set to InvalidData.
Unsupported features such as integer variables are reported similarly.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MpsFile
impl RefUnwindSafe for MpsFile
impl Send for MpsFile
impl Sync for MpsFile
impl Unpin for MpsFile
impl UnwindSafe for MpsFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more