21 using namespace Couenne;
32 int xi,
int yi,
int wi) {
42 int xsign = (x1 >= 0) ? 1 : -1,
43 ysign = (y1 >= 0) ? 1 : -1;
49 xp = yp = sqrt (fabs (wb))/2;
50 if (xsign<0) xp = -xp;
51 if (ysign<0) yp = -yp;
53 else {xp = sqrt (fabs(wb/yp));
if (xsign<0) xp=-xp;}
54 else if (((ysign > 0) ? yp : -yp) <=
COUENNE_EPS) {yp = sqrt (fabs(wb/xp));
if (ysign<0) yp=-yp;}
62 *lb = cg -> Problem () -> Lb (),
63 *ub = cg -> Problem () -> Ub (),
64 xL = lb [xi], xU = ub [xi],
65 yL = lb [yi], yU = ub [yi];
72 if ((xt < xL) && (xL != 0.)) xt = xL;
73 if ((xt > xU) && (xU != 0.)) xt = xU;
75 if ((wb / xt < yL) && (yL != 0.)) xt = wb / yL;
76 if ((wb / xt > yU) && (yU != 0.)) xt = wb / yU;
82 (fabs (x1*y1 - wb) > 0.)) ?
83 ((2*wb/xt - y1 - wb*x1 / (xt*xt)) / (x1*y1 - wb)) : 0;
89 cg -> createCut (cs, alpha*wb + 2*wb/xt, sign, wi, alpha, yi, 1., xi, wb/(xt*xt));
90 else cg -> createCut (cs, 2*wb/xt, sign, yi, 1., xi, wb/(xt*xt));
102 bool cLX, cRX, cLY, cRY, cLW, cRW =
103 cLX = cRX = cLY = cRY = cLW =
true;
105 if (!(cg -> isFirst ()) && chg) {
122 if ((cLX || cLY) &&
is_boundbox_regular (yl, xl)) cg -> createCut (cs,yl*xl,-1,wi,-1.,xi,yl,yi,xl);
123 if ((cRX || cRY) &&
is_boundbox_regular (yu, xu)) cg -> createCut (cs,yu*xu,-1,wi,-1.,xi,yu,yi,xu);
127 if ((cRX || cLY) &&
is_boundbox_regular (yl, xu)) cg -> createCut (cs,yl*xu,+1,wi,-1.,xi,yl,yi,xu);
128 if ((cLX || cRY) &&
is_boundbox_regular (yu, xl)) cg -> createCut (cs,yu*xl,+1,wi,-1.,xi,yu,yi,xl);
174 if ((xyl < wl) && (xu*yu >= wl))
contourCut (cg,cs, x0,y0, wl, +1, xl,yl, xu,yu, xi,yi,wi);
175 else if ((xyl >= wl) && (xu*yu < wl))
contourCut (cg,cs, x0,y0, wl, -1, xu,yu, xl,yl, xi,yi,wi);
185 if ((xuyl > wu) && (xl*yu <= wu))
contourCut (cg,cs, x0,y0, wu, +1, xu,yl, xl,yu, xi,yi,wi);
186 else if ((xuyl <=wu) && (xl*yu > wu))
contourCut (cg,cs, x0,y0, wu, -1, xl,yu, xu,yl, xi,yi,wi);
Cut Generator for linear convexifications.
void unifiedProdCuts(const CouenneCutGenerator *, OsiCuts &, int, CouNumber, CouNumber, CouNumber, int, CouNumber, CouNumber, CouNumber, int, CouNumber, CouNumber, CouNumber, t_chg_bounds *, enum expression::auxSign)
unified convexification of products and divisions
CouNumber powNewton(CouNumber xc, CouNumber yc, unary_function f, unary_function fp, unary_function fpp)
find proper tangent point to add deepest tangent cut
status of lower/upper bound of a variable, to be checked/modified in bound tightening ...
const char & lower() const
const char & upper() const
bool is_boundbox_regular(register CouNumber b1, register CouNumber b2)
check if bounding box is suitable for a multiplication/division convexification constraint ...
auxSign
"sign" of the constraint defining an auxiliary.
void contourCut(const CouenneCutGenerator *cg, OsiCuts &cs, CouNumber xp, CouNumber yp, CouNumber wb, int sign, CouNumber x0, CouNumber y0, CouNumber x1, CouNumber y1, int xi, int yi, int wi)
Add cut around curve x*y=k.
void upperEnvHull(const CouenneCutGenerator *cg, OsiCuts &cs, int xi, CouNumber x0, CouNumber xl, CouNumber xu, int yi, CouNumber y0, CouNumber yl, CouNumber yu, int wi, CouNumber w0, CouNumber wl, CouNumber wu)
better cuts than those from unifiedProdCuts
double CouNumber
main number type in Couenne