reset_basis

Resets the basis to the initial basis.

void reset_basis(lprec *lp);

Return Value

reset_basis has no return value.

Parameters

lp

Pointer to previously created lp model. See return value of make_lp, read_lp, read_LP, read_lpt, read_LPT, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI

Remarks

The reset_basis function resets the basis to the initial basis.
The default initial basis is bascolumn[x] = x.
Setting an initial basis can speed up the solver considerably. It is the starting point from where the algorithm continues to find an optimal solution.
When a restart is done, lp_solve continues at the last basis, except if reset_basis or set_basis is called.

Example

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

int main(void)
{
  lprec *lp;

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

  reset_basis(lp);

  delete_lp(lp);
  return(0);
}

lp_solve API reference

See Also make_lp, read_lp, read_LP, read_lpt, read_LPT, read_mps, read_freemps, read_MPS, read_freeMPS, read_XLI, get_basis, set_basis, default_basis, get_basiscrash set_basiscrash