# set_maxpivot

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

void set_maxpivot(lprec *lp, int max_num_inv);

Return Value

set_maxpivot has no return value.

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

max_num_inv

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

Remarks

The set_maxpivot 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 250 for the LUSOL bfp and 42 for the other BFPs.

Example

    #include <stdio.h>
    #include <stdlib.h>
    #include "lp_lib.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_maxpivot(lp, 10);

      delete_lp(lp);
      return(0);
    }

lp_solve API reference

See Also make_lp, copy_lp, read_lp, read_LP, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, get_maxpivot