get_col_name

Gets the name of a column in the lp.

char *get_col_name(lprec *lp, int column);

Return Value

get_col_name returns the name of the specified column. 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

column

The column for which the name must be retrieved. Must be between 1 and the number of columns in the lp.

Remarks

The get_col_name returns the name of the column.
Column names are optional. If no column name was specified, the function returns v_x with x the column number.

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

  name = get_col_name(lp, 1); /* will be v_1 since no column 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_col_name, set_row_name, get_row_name