00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "CouenneTypes.hpp"
00012 #include "CouenneCutGenerator.hpp"
00013 #include "exprSub.hpp"
00014 #include "exprOpp.hpp"
00015
00016
00017 void exprSub::generateCuts (expression *w, const OsiSolverInterface &si,
00018 OsiCuts &cs, const CouenneCutGenerator *cg,
00019 t_chg_bounds *chg,
00020 int wind, CouNumber lb, CouNumber ub) {
00021
00022 if (!(cg -> isFirst ()))
00023 return;
00024
00025
00026
00027 expression *x = arglist_ [0];
00028 expression *y = arglist_ [1];
00029
00030 int wi = w -> Index ();
00031 int xi = x -> Index ();
00032 int yi = y -> Index ();
00033
00034 if (wind >= 0) wi = -1;
00035 else lb = ub = 0;
00036
00037 if (xi < 0) {
00038 CouNumber x0 = x -> Value ();
00039 lb -= x0;
00040 ub -= x0;
00041 }
00042
00043 if (yi < 0) {
00044 CouNumber y0 = y -> Value ();
00045 lb += y0;
00046 ub += y0;
00047 }
00048
00049 cg -> createCut (cs, lb, ub, wi, -1., xi, 1., yi, -1., true);
00050 }