column_in_lp

Check if a column is already present in the lp.

int column_in_lp(lprec *lp, REAL *column);

Return Value

column_in_lp returns TRUE (1) if the column is already in the lp and FALSE (0) if not.

Parameters

lp

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

column

An array with row elements that are checked against the existing columns in the lp.

Remarks

The column_in_lp functions checks if a column is already present in the lp.
It does not look at bounds and types, only at matrix values.

Example

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

int main(void)
{
  lprec *lp;
  REAL column[1+2]; /* must be 1 more then number of rows ! */
  int ret;

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

  column[0] = 0.0;
  column[1] = 0.0;
  column[2] = 0.0;
  ret = column_in_lp(lp, column); /* Will return TRUE */

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, read_lp, read_lp_file, read_LP, read_mps, read_MPS, add_column, str_add_column, del_column