# is_obj_in_basis

Returns if the objective is in the matrix or not.

unsigned char is_obj_in_basis(lprec *lp);

Return Value

is_obj_in_basis returns if the objective is in the matrix or not.

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 is_obj_in_basis function returns if the objective is in the matrix or not.
The default is that the objective is in the matrix (TRUE).

By default, the objective function is stored as the top row in the constraint matrix When this function is called with obj_in_basis = FALSE then it is moved out into separate storage. When out of the basis, the computation of reduced costs is somewhat slower. In the late versions of v5.5, there is now the option to calculate reduced cost in the textbook way, i.e. completely independently of the basis.

Example

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

    int main(void)
    {
      lprec *lp;
      unsigned char obj_in_basis;

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

      obj_in_basis = is_obj_in_basis(lp); /* Will return 1 (TRUE) */

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