Mps Reader.Read Method
Definition
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Read( | Reads a linear programming model from a stream. |
Read( | Reads a linear programming model from an MPS file. |
Read(StreamReader)
public static LinearProgram Read(
StreamReader reader
)
Parameters
- reader StreamReader
- A StreamReader.
Return Value
LinearProgramThe QuadraticProgram read in MPS format from reader.
Remarks
Use this method to read a linear program from a stream in MPS format.
Several extensions of the MPS format have been defined over the years. The current implementation of MpsReader doesn't support these extensions. A FormatException is thrown when an unrecognized extension is found.
The MPS format is also used to specify Integer Programming (IP) and Mixed Integer Programming (MIP) problems. The QuadraticProgram class does not support these types of problems. When integer variables are encountered in an MPS file, a NotSupportedException is thrown.
Exceptions
Argument | reader is null. |
Format | The data is not in correct MPS format. |
Not | The data contains features, such as integer variables, that are not supported. |
IOException | An I/O error has occurred. |
Read(String)
public static LinearProgram Read(
string path
)
Parameters
- path String
- The path to the MPS file.
Return Value
LinearProgramThe LinearProgram contained in the file specified by path.
Remarks
Use this method to read a linear program from a file in MPS format.
Several extensions of the MPS format have been defined over the years. The current implementation of MpsReader doesn't support these extensions. A FormatException is thrown when an unrecognized extension is found.
Exceptions
Format | The data is not in correct MPS format. |
Not | The data contains features, such as integer variables, that are not supported. |
IOException | An I/O error has occurred. |
Unauthorized | The caller does not have the required permission. |
Argument | path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars(). |
Argument | path is null. |
Path | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
Directory | The specified path is invalid, (for example, it is on an unmapped drive). |
File | The file specified in path was not found. |
Argument | path is null. |