is_SOS_var

Returns if the variable is SOS (Special Ordered Set) or not.

unsigned char is_SOS_var(lprec *lp, int column);

Return Value

is_SOS_var returns TRUE (1) if the variable is a SOS var, FALSE (0) if not.

Parameters

lp

Pointer to previously created lp model. See return value of make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI

column

The column number of the variable that must be checked. It must be between 1 and the number of columns in the lp.

Remarks

The is_SOS_var function returns if a variable is a SOS variable or not. Default a variable is not SOS. A variable becomes a SOS variable via add_SOS. See Special Ordered Sets for a description about SOS variables.

Example

#include <stdio.h>
#include <stdlib.h>
#include "lp_lib.h"

int main(void)
{
  lprec *lp;
  int isSOS;

  /* Create a new LP model */
  lp = make_lp(0, 1);
  if(lp == NULL) {
    fprintf(stderr, "Unable to create new LP model\n");
    return(1);
  }

  isSOS = is_SOS_var(lp, 1); /* will return 0 since the variable is not an SOS var at this point */

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, add_SOS