 |
 |
 |
 |
Purpose |
 |
 |
Write a basis to a file.
|
 |
Synopsis |
 |
 |
int QSwrite_basis (QSprob p, QSbas B, const char *filename)
|
 |
Arguments |
 |
p |
 |
a handle to an initialized problem. |
B |
 |
a handle to a basis for the problem; this argument can be NULL , in which case the basis written will be the current optimal basis for the problem. |
filename |
 |
a string specifying the name of the file to store the basis. |
|
 |
Returns |
 |
 |
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that if B is NULL , then QSwrite_basis returns an error code if it is called with a specified problem that has not been solved with one of the optimization functions ( QSopt_dual or QSopt_primal) since the last time the problem was loaded or modified.
|
 |
Description |
 |
 |
This can be used to store a basis directly in a file, avoiding the format issues that arise in the use of the QSget_basis_array function. The B argument can be used to specify the basis, or B can be set to NULL to specify that the current optimal basis for the LP problem should be written to the file. The basis file is written the industry standard MPS Basis format. (This is the format that is used by QSread_basis.)
|
 |
Example |
 |
 |
/* p is an initialized QSprob, a handle to an existing LP problem */
int rval;
rval = QSwrite_basis (p, (QSbas) NULL, "binky.bas");
if (rval) {
fprintf (stderr,
"Could not write the basis, error code %d\n", rval);
}
|
 |
|
|