QSopt QSget_intflags QSopt > Callable Library > Function List
  QSopt
  Downloads
  LP Info
  Software
  Problem Formats
  Callable Library
  Overview
Function List
  Rational Solver
  Beta
  Contact Info
Purpose
Get flags indicating the integer variables.
Synopsis
int QSget_intflags (QSprob p, int *intflags)
Arguments
p a handle to an initialized problem.
intflags returns an array of length ncols (the number of columns in the problem) of 0 - 1 values; the jth entry is 1 if the jth variable is an integer variable and the jth entry is 0 otherwise; this array must be allocated by the calling routine.
Returns
A zero value if the function terminated correctly, and a non-zero value if an error occurred.
Description

This function can be used to determine the integer variables in the problem, that is, the variables that are required to take on integer values. The argument intflags must point to an array of length at least ncols, the number of columns in the problem. The first ncols entries of intflags will be set to 0 or 1, with the 1's indicating the integer variables.

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

int j, ncols;
int *intflags;

ncols = QSget_colcount (p);
intflags = (int *) malloc (ncols * sizeof (int));

rval = QSget_intflags (p, intflags);
if (rval) {
    fprintf (stderr, "could not get intflags, error code %d\n", rval);
} else {
    printf ("Integer Variables\n");
    for (j = 0; j < ncols; j++) {
        if (intflags[j] == 1) {
            printf ("%d ", j);
        }
    }
    printf ("\n");
}

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