QSopt QSget_named_x 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 solution value of a named variable.
Synopsis
int QSget_named_x (QSprob p, const char *colname, double *val)
Arguments
p a handle to an initialized problem.
colname a string specifying the name of a variable.
val returns the solution value of the named variable.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred. Note that QSget_named_x 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 variable 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 a variable specified by its name.

Example
/* p is an initialized QSprob, a handle to an existing LP problem  */
/* Get the solution value of the variable z.                       */

int rval;
double val;

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