del_column

Remove a column from the lp.

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

Return Value

del_column returns TRUE (1) if the operation was successful. A return value of FALSE (0) indicates an error.
An error occurs when column is not between 1 and the number of columns in the lp.
Note that row entry mode must be off, else this function also fails. See set_add_rowmode

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 to delete. Must be between 1 and the number of columns in the lp.

Remarks

The del_column function deletes a column from the model. The column is effectively deleted, so all columns after this column shift one left.
Note that column 0 (the right hand side (RHS)) cannot be deleted. There is always a RHS.

Note that if you can also delete multiple columns by a call to resize_lp.

Example

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

int main(void) 
{
  lprec *lp;

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

  del_column(lp, 1);

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also resize_lp, make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, add_column, add_columnex, str_add_column