00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "CouenneTypes.hpp"
00012 #include "CouenneProblemElem.hpp"
00013
00014 #include <cstdio>
00015
00016
00017
00018 void CouenneConstraint::print (std::ostream &out) {
00019
00020 bool samebounds = ((lb_ -> Type () == CONST) &&
00021 (ub_ -> Type () == CONST) &&
00022 (fabs (lb_ -> Value () - ub_ -> Value ()) < COUENNE_EPS));
00023
00024
00025
00026 if (lb_ &&
00027 !samebounds &&
00028 ((lb_ -> Type () != CONST) ||
00029 (lb_ -> Value () > - COUENNE_INFINITY))) {
00030
00031 lb_ -> print (out); fflush (stdout);
00032 out << " <= "; fflush (stdout);
00033 }
00034
00035
00036
00037 body_ -> print (out); fflush (stdout);
00038
00039
00040
00041 if (ub_ && ((ub_ -> Type () != CONST) ||
00042 (ub_ -> Value () < COUENNE_INFINITY))) {
00043
00044 out << ' ';
00045 if (!samebounds) out << "<";
00046 out << "= "; fflush (stdout);
00047 ub_ -> print (out); fflush (stdout);
00048 }
00049
00050 out << std::endl;
00051 }