# set_print_sol

Sets a flag if all intermediate valid solutions must be printed while solving.

void set_print_sol(lprec *lp, int print_sol);

Return Value

set_print_sol 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

print_sol

FALSE (0) | No printing
TRUE (1) | Print all values
AUTOMATIC (2) | Print only non-zero values

Remarks

The set_print_sol function sets a flag if all intermediate valid solutions must be printed while solving. Can give you useful solutions even if the total run time is too long. This function is mend for debugging purposes. The default is not to print (FALSE).

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_print_sol(lp, 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, get_print_sol