QSopt QSread_prob QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Read a problem from a named file.
Synopsis
QSprob QSread_prob (const char *filename, const char *filetype)
Arguments
filename a string specifying the name of the file containing the problem
filetype use "LP" to read a file in LP format or "MPS" to read a file in MPS format
Returns
An initialized QSprob object, providing a handle to the problem described in the specified file. If an error occurred, the QSprob object is set to NULL.
Description

This function can read LP problems in either MPS format or in LP format. To specify MPS format, set filetype to "MPS" (the letters can be any mix of uppercase and lowercase), and to specify LP format, set filetype to "LP". If some other string is specified, an error code will be returned.

MPS format is a standard file format for recording LP problems. The format was created at IBM in the 1960s, and the original standard included fixed-column information (a common feature in the days of punched cards). An introduction to the format can be found at ftp://plato.asu.edu/pub/mps_format.txt. The QSopt MPS reader follows a number of other modern LP solvers in removing the fixed-column aspects of the format.

LP format is a well-established format for recording algebraic representations of LP problems, in a natural, row by row, manner. The QSopt LP format is compatible with the standard usage of the LP file format incorporated in other LP solvers.

A complete description of the two formats used in QSopt is given in Problem Formats.

Example
QSprob p;

/* Read a problem in MPS format given in the file binky.mps */

p = QSread_prob ("binky.mps", "MPS");
if (p == (QSprob) NULL) {
    fprintf (stderr, "Unable to read and load the LP\n");
} else {
    /* We can solve and/or modify the problem using the handle p */
}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003