QSopt QSwrite_prob_file QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Write the problem to an open file.
Synopsis
int QSwrite_prob_file (QSprob p, FILE *file, const char *filetype)
Arguments
p a handle to an initialized problem.
file a handle to a file that is open for writing.
filetype use "LP" to write a file in LP format or "MPS" to write a file in MPS format
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred.
Description

Writes problem p to an open file in LP format or MPS format. The argument file should be a handle to a file that is open for writing. The use of the argument filetype to specify the format of the output file is the same as in the function QSwrite_prob.

This function gives an easy way to write the problem to the screen by specifying the file as stdout or stderr. The function can also be used to store the LP along with other information in a given file. To simply open a file and write the LP, it is usually easier to use the function QSwrite_prob.

Example
/* p is a QSprob, a handle to an existing LP problem. */
/* Write the problem to the screen in LP format.      */

int rval;

rval = QSwrite_prob_file (p, stdout, "LP");
if (rval) {
    fprintf (stderr,
             "Could not write LP to stdout, error code %d\n", rval);
}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003