set_row_name

Set the name of a constraint (row) in the lp.

unsigned char set_row_name(lprec *lp, int row, char *new_name);

Return Value

set_row_name returns TRUE (1) if the operation was successful. A return value of FALSE (0) indicates an error.

Parameters

lp

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

row

The row for which the name must be set. Must be between 0 and the number of rows in the lp.

new_name

The name for the row.

Remarks

The set_row_name sets the name of the row.
The row must already exist. row 0 is the objective function. Row names are optional.

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, 0);
  if(lp == NULL) {
    fprintf(stderr, "Unable to create new LP model\n");
    return(1);
  }

  set_row_name(lp, 1, "row1");

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, get_row_name, get_origrow_name, set_col_name, get_col_name, get_origcol_name, get_nameindex