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

The value of objsense is set to QS_MIN for a minimization problem and QS_MAX for a maximization problem.

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

int objsense;

rval = QSget_objsense (p, &objsense);
if (rval) {
    fprintf (stderr, "could not get objsense, error code %d\n", rval);
} else {
    if (objsense == QS_MIN) {
        printf ("Minimization problem\n");
    } else {
        printf ("Maxmization problem\n");
    }
}

 
QSopt | Problem Formats | Downloads Back
Last Updated: September 2005