The print_objective function prints the objective value of the lp. This can only be done after a successful solve.
This function is meant for debugging purposes. By default, the output is stdout. However
this can be changed via a call to set_outputstream, set_outputfile.