QSopt QSget_named_slack 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 slack value associated with a named row.
Synopsis
int QSget_named_slack (QSprob p, const char *rowname, double *val)
Arguments
p a handle to an initialized problem.
rowname a string specifying the name of a constraint.
val returns the slack value associated with the named constraint.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that QSget_named_slack 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. An error will also occur if the named constraint is not in the LP problem.
Description

After a successful call to one of the optimization routines ( QSopt_dual or QSopt_primal), this function can be used to obtain the slack value (corresponding to the LP solution) for the named constraint.

Example
/* p is an initialized QSprob, a handle to an existing LP problem  */
/* Get the slack value for the constraint r2.                      */

int rval;
double val;

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