QSopt QSget_pi_array QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Copy the values of the dual variables into an array.
Synopsis
int QSget_pi_array (QSprob p, double *pi)
Arguments
p a handle to an initialized problem.
pi returns the values of the dual variables as an array; this should point to an array of length at least nrows, the number of rows in the problem.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that QSget_pi_array 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

This function returns the dual solution to the LP problem as a dense vector, that is, the values of all dual variables (both zero and non-zero) are returned in the array pi. Note that the values of the dual variables associated with lower and upper bounds are given implicitly by the array pi.

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

int rval, nrows;
double *pi;

nrows = QSget_rowcount (p);
pi = (double *) malloc (nrows * sizeof (double));

rval = QSget_pi_array (p, pi);
if (rval) {
    fprintf (stderr,
             "Could not get dual values, error code %d\n", rval);
} else {
    /* To print dual values with names, see QSget_solution() example. */
}

free (pi);
 
QSopt | Problem Formats | Downloads Back
Last Updated: November 2003