set_max_num_inv

Sets the maximum number of pivots between a re-inversion of the matrix.

void set_max_num_inv(lprec *lp, int max_num_inv);

Return Value

set_max_num_inv 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

max_num_inv

The maximum number of pivots between a re-inversion of the matrix.

Remarks

The set_max_num_inv function sets the maximum number of pivots between a re-inversion of the matrix.
For stability reasons, lp_solve re-inverts the matrix on regular times. max_num_inv determines how frequently this inversion is done. This can influence numerical stability. However, the more often this is done, the slower the solver becomes.
The default is 30.

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_max_num_inv(lp, 10);

  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_max_num_inv