get_Norig_columns

Returns the number of original columns (variables) in the lp.

int get_Norig_columns(lprec *lp);

Return Value

get_Norig_columns returns the number of original columns (variables) in the lp.

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

Remarks

The get_Norig_columns function returns the number of original columns (variables) in the lp.
Note that the number of columns (get_Ncolumns) can change when a presolve is done or when negative variables are split in a positive and a negative part. get_Norig_columns does not change and thus returns the original number of columns in the lp.

Example

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

int main(void)
{
  lprec *lp;
  int Norig_columns;

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

  Norig_columns = get_Norig_columns(lp); /* Will return 1 */

  set_presolve(lp, PRESOLVE_COLS);
  solve(lp);

  Norig_columns = get_Norig_columns(lp); /* Will return 1 */

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, copy_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, get_Ncolumns, get_Nrows, get_Norig_rows, get_orig_index, get_lp_index, get_Lrows