set_piv_rule

Specifies the pivot rule.

void set_piv_rule(lprec *lp, short pivot_rule);

Return Value

set_piv_rule has no return value.

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

pivot_rule

The pivot rule. Can by any of the following values:

FIRST_SELECT (0) Select first appropriate pivot row/column
BEST_SELECT (3) Algorithm chooses the most appropriate pivot row/column
GREEDY_SELECT (5) Choose pivot row/column that results in largest object value change

Remarks

The set_piv_rule function specifies the pivot rule (rule for selecting row and column entering/leaving). This rule can influence solving times considerably. Depending on the model one rule can be best and for another model another rule.
The default is BEST_SELECT (3).

Example

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

int main(void)
{
  lprec *lp;

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

  set_piv_rule(lp, FIRST_SELECT);

  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, get_piv_rule