MpsReader.ReadQuadraticProgram Method

Definition

Namespace: Extreme.Mathematics.Optimization
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23

Overload List

ReadQuadraticProgram(StreamReader) Reads a quadratic programming model from a stream.
ReadQuadraticProgram(String) Reads a quadratic programming model from an MPS file.

MpsReader.ReadQuadraticProgram(StreamReader)

Reads a quadratic programming model from a stream.
C#
public static QuadraticProgram ReadQuadraticProgram(
	StreamReader reader
)

Parameters

reader  StreamReader
A StreamReader.

Return Value

QuadraticProgram
The LinearProgram read in MPS format from reader.

Remarks

Use this method to read a quadratic 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 LinearProgram class does not support these types of problems. When integer variables are encountered in an MPS file, a NotSupportedException is thrown.

Exceptions

ArgumentNullExceptionreader is null.
FormatException The data is not in correct MPS format.
NotSupportedException The data contains features, such as integer variables, that are not supported.
IOExceptionAn I/O error has occurred.

MpsReader.ReadQuadraticProgram(String)

Reads a quadratic programming model from an MPS file.
C#
public static QuadraticProgram ReadQuadraticProgram(
	string path
)

Parameters

path  String
The path to the MPS file.

Return Value

QuadraticProgram
The QuadraticProgram contained in the file specified by path.

Remarks

Use this method to read a quadratic 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.

The MPS format is also used to specify Integer Programming (IP) and Mixed Integer Programming (MIP) problems. The LinearProgram class does not support these types of problems. When integer variables are encountered in an MPS file, a NotSupportedException is thrown.

Exceptions

FormatException The data is not in correct MPS format.
NotSupportedException The data contains features, such as integer variables, that are not supported.
IOExceptionAn I/O error has occurred.
UnauthorizedAccessExceptionThe caller does not have the required permission.
ArgumentExceptionpath is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars().
ArgumentNullExceptionpath is null.
PathTooLongExceptionThe 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.
DirectoryNotFoundExceptionThe specified path is invalid, (for example, it is on an unmapped drive).
FileNotFoundExceptionThe file specified in path was not found.
ArgumentNullExceptionpath is null.

See Also