del_constraint

Remove a constraint from the lp.

int del_constraint(lprec *lp, int row);

Return Value

del_constraint returns TRUE (1) if the operation was successful. A return value of FALSE (0) indicates an error.
An error occurs when row is not between 1 and the number of rows in the lp.

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

row

The row to delete. Must be between 1 and the number of rows in the lp.

Remarks

The del_constraint function deletes a row from the model. The row is effectively deleted, so all rows after this row shift one up.
Note that row 0 (the objective function) cannot be deleted. There is always an objective function.

Example

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

int main(void)
{
  lprec *lp;

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

  del_constraint(lp, 1);

  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_constraint, str_add_constraint