QSopt QSget_status QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Obtain the solution status.
Synopsis
int QSget_status (QSprob p, int *status)
Arguments
p a handle to an initialized problem.
status returns the solution status of the LP problem.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred.
Description

If the problem p has been modified since the last time QSopt_dual or QSopt_primal has been called to solve p, then status is set to QS_LP_MODIFIED (this has numerical value 100). Otherwise, status is set to the value that was associated with the last call to QSopt_dual or QSopt_primal, as specified in Optimization Status Codes.

Example
/* p is an initialized QSprob, a handle to an existing LP problem  */

int rval, status;

rval = QSget_status (p, &status);
if (rval) {
    fprintf (stderr, "Unable to obtain status, error code %d\n", rval);
} else {
    switch (status) {
    case QS_LP_OPTIMAL:
        printf ("An optimal solution is available\n");
        break;
    case QS_LP_INFEASIBLE:
        printf ("The LP has no feasible solution\n");
        break;
    case QS_LP_UNBOUNDED:
        printf ("The LP has unbounded objective value\n");
        break;
    case QS_ITER_LIMIT:
        printf ("The optimizer reached its iteration limit\n");
        break;
    case QS_TIME_LIMIT:
        printf ("The optimizer reached its time limit\n");
        break;
    case QS_LP_UNSOLVED:
        printf ("The optimizer could not solve the LP\n");
        break;
    case QS_LP_MODIFIED:
        printf ("The LP was modified since last optimization call\n");
        break;
    default:
        printf ("Unknown solution status: %d\n", status);
        break;
    }

}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003