get_row_name

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

char *get_row_name(lprec *lp, int row);

Return Value

get_row_name returns the name of the specified row. A return value of NULL indicates an error.

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 for which the name must be retrieved. Must be between 0 and the number of rows in the lp.

Remarks

The get_row_name returns the name of the row.
Row names are optional. If no row name was specified, the function returns r_x with x the row number. row 0 is the objective function.

Example

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

int main(void)
{
  lprec *lp;
  char *name;

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

  name = get_row_name(lp, 1); /* will be r_1 since no row name was set */

  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, set_row_name, set_col_name, get_col_name