QSopt QSget_objval QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Get the current objective function value.
Synopsis
int QSget_objval (QSprob p, double *value)
Arguments
p a handle to an initialized problem.
value returns the value of the objective function.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that QSget_objval 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

After a successful call to one of the optimization routines ( QSopt_dual or QSopt_primal), this function can be used to obtain the value of the objective function.

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

int rval;
double value;

rval = QSget_objval (p, &value);
if (rval) {
    fprintf (stderr, 
            "Could not get objective value, error code %d\n", rval);
} else {
    printf ("Objective value = %.6f\n", value);
}
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003