QSopt QSget_named_pi 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 dual value associated with a named row.
Synopsis
int QSget_named_pi (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 dual 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_pi 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 value of the dual variable associated with a constraint specified by name.

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

int rval;
double val;

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