QSopt QSget_rc_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 reduced costs into an array.
Synopsis
int QSget_rc_array (QSprob p, double *rc)
Arguments
p a handle to an initialized problem.
rc returns the reduced costs of the variables; this field should point to an array of length at least ncols, the number of columns in the problem.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that QSget_rc_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 reduced costs of the variables in the LP problem as a dense vector, that is, values for all variables (both zero and non-zero) are returned in the array rc.

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

int rval, ncols;
double *rc;

ncols = QSget_colcount (p);
rc = (double *) malloc (ncols * sizeof (double));

rval = QSget_rc_array (p, rc);
if (rval) {
    fprintf (stderr, 
             "Could not get reduced costs, error code %d\n", rval);
} else {
    /* See QSget_solution() to print named reduced cost values */
}

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