CouenneObject.cpp
Go to the documentation of this file.
1 /* $Id: CouenneObject.cpp 817 2012-02-08 04:13:04Z pbelotti $
2  *
3  * Name: CouenneObject.cpp
4  * Authors: Pierre Bonami, IBM Corp.
5  * Pietro Belotti, Carnegie Mellon University
6  * Purpose: Base object for variables (to be used in branching)
7  *
8  * (C) Carnegie-Mellon University, 2006-10.
9  * This file is licensed under the Eclipse Public License (EPL)
10  */
11 
12 #include "CouenneProblem.hpp"
13 #include "CouenneProblemElem.hpp"
14 #include "CouenneObject.hpp"
16 
17 #include "CoinHelperFunctions.hpp"
18 
19 using namespace Ipopt;
20 using namespace Couenne;
21 
22 static const double init_estimate = COUENNE_EPS;
23 
25 CouenneObject::CouenneObject ():
26 
27  OsiObject (),
28  cutGen_ (NULL),
29  problem_ (NULL),
30  reference_ (NULL),
31  strategy_ (MID_INTERVAL),
32  jnlst_ (NULL),
33  alpha_ (default_alpha),
34  lp_clamp_ (default_clamp),
35  feas_tolerance_ (feas_tolerance_default),
36  doFBBT_ (true),
37  doConvCuts_ (true),
38  downEstimate_ (init_estimate),
39  upEstimate_ (init_estimate),
40  pseudoMultType_ (INFEASIBILITY) {}
41 
42 
45  CouenneProblem *p,
46  exprVar *ref,
47  Bonmin::BabSetupBase *base,
48  JnlstPtr jnlst):
49  OsiObject (),
50 
51  cutGen_ (cutgen),
52  problem_ (p),
53  reference_ (ref),
54  strategy_ (MID_INTERVAL),
55  jnlst_ (jnlst),
56  alpha_ (default_alpha),
57  lp_clamp_ (default_clamp),
58  feas_tolerance_ (feas_tolerance_default),
59  doFBBT_ (true),
60  doConvCuts_ (true),
61  downEstimate_ (init_estimate),
62  upEstimate_ (init_estimate),
63  pseudoMultType_ (INFEASIBILITY) {
64 
65  // read options
66  setParameters (base);
67 
68  // debug output ////////////////////////////////////////////
69 
70  if (reference_ &&
71  (reference_ -> Type () == AUX) &&
72  jnlst_ -> ProduceOutput (J_SUMMARY, J_BRANCHING)) {
73 
74  printf ("created Expression Object: "); reference_ -> print ();
75  if (reference_ -> Image ()) {
76  printf (" := ");
77  reference_ -> Image () -> print ();
78  }
79 
80  printf (" with %s strategy [clamp=%g, alpha=%g]\n",
81  (strategy_ == LP_CLAMPED) ? "lp-clamped" :
82  (strategy_ == LP_CENTRAL) ? "lp-central" :
83  (strategy_ == BALANCED) ? "balanced" :
84  (strategy_ == MIN_AREA) ? "min-area" :
85  (strategy_ == MID_INTERVAL) ? "mid-point" :
86  (strategy_ == NO_BRANCH) ? "no-branching (null infeasibility)" :
87  "no strategy",
88  lp_clamp_, alpha_);
89  }
90 }
91 
92 
95  Bonmin::BabSetupBase *base,
96  JnlstPtr jnlst):
97 
98  OsiObject (),
99  cutGen_ (NULL),
100  problem_ (NULL),
101  reference_ (ref),
102  strategy_ (MID_INTERVAL),
103  jnlst_ (jnlst),
104  alpha_ (default_alpha),
105  lp_clamp_ (default_clamp),
106  feas_tolerance_ (feas_tolerance_default),
107  doFBBT_ (true),
108  doConvCuts_ (true),
109  downEstimate_ (init_estimate),
110  upEstimate_ (init_estimate),
111  pseudoMultType_ (INFEASIBILITY) {
112 
113  // read options
114  setParameters (base);
115 }
116 
117 
120  OsiObject (src),
121  cutGen_ (src.cutGen_),
122  problem_ (src.problem_),
123  reference_ (src.reference_),
124  strategy_ (src.strategy_),
125  jnlst_ (src.jnlst_),
126  alpha_ (src.alpha_),
127  lp_clamp_ (src.lp_clamp_),
128  feas_tolerance_ (src.feas_tolerance_),
129  doFBBT_ (src.doFBBT_),
130  doConvCuts_ (src.doConvCuts_),
131  downEstimate_ (src.downEstimate_),
132  upEstimate_ (src.upEstimate_),
133  pseudoMultType_ (src.pseudoMultType_) {}
134 
135 
139 
140 double CouenneObject::intInfeasibility (double value, double lb, double ub) const {
141 
142  if (value < lb) value = lb;
143  else if (value > ub) value = ub;
144 
145  return CoinMin (value - floor (value + COUENNE_EPS),
146  ceil (value - COUENNE_EPS) - value);
147 }
148 
149 
151 OsiBranchingObject *CouenneObject::createBranch (OsiSolverInterface *si,
152  const OsiBranchingInformation *info,
153  int way) const {
154 
155  // a nonlinear constraint w = f(x) is violated. The infeasibility
156  // should be given by something more elaborate than |w-f(x)|, that
157  // is, it is the minimum, among the two branching nodes, of the
158  // distance from the current optimum (w,x) and the optimum obtained
159  // after convexifying the two subproblems. We call selectBranch for
160  // the purpose, and save the output parameter into the branching
161  // point that should be used later in createBranch.
162 
163  if (jnlst_ -> ProduceOutput (J_ITERSUMMARY, J_BRANCHING)) {
164  printf ("CouObj::createBranch on ");
165  reference_ -> print (); printf ("\n");
166  }
167 
168  // copy current point into Couenne
169  problem_ -> domain () -> push
170  (problem_ -> nVars (),
171  info -> solution_,
172  info -> lower_,
173  info -> upper_,
174  false);
175 
176  CouNumber
177  *brPts = NULL, // branching point(s)
178  *brDist = NULL; // distances from current LP point to each
179  // new convexification (usually two)
180  expression *brVar = NULL; // branching variable
181  int whichWay = 0;
182 
183  CouNumber improv;
184 
185  if (reference_ -> Image ()) // not used out of debug
186  improv = reference_ -> Image () ->
187  selectBranch (this, info, // input parameters
188  brVar, brPts, brDist, whichWay); // result: who, where, distance, and direction
189  else {
190 
191  // reference_ -> Image () == NULL implies this is an integer object
192 
193  brVar = reference_;
194  brPts = (double *) realloc (brPts, sizeof (double));
195  brDist = (double *) realloc (brDist, 2 * sizeof (double));
196 
197  double point = info -> solution_ [reference_ -> Index ()];
198 
199  *brPts = point;
200  improv = 0.;
201 
202  if (point > floor (point)) {improv = brDist [0] = point - floor (point);}
203  if (point < ceil (point)) {improv = CoinMin (improv, brDist [1] = ceil (point) - point);}
204 
205  point -= floor (point);
206  whichWay = (point < 0.45) ? TWO_LEFT : (point > 0.55) ? TWO_RIGHT : TWO_RAND;
207  }
208 
209  assert (brVar); // MUST have a branching variable
210 
211  /* if (pseudoMultType_ == INTERVAL) {
212  int index = brVar -> Index ();
213  downEstimate_ = *brPts - info -> lower_ [index];
214  upEstimate_ = info -> upper_ [index] - *brPts;
215  } else if (pseudoMultType_ == REV_INTERVAL) {
216  int index = brVar -> Index ();
217  downEstimate_ = *brPts - info -> upper_ [index]; // notice upper&lower inverted
218  upEstimate_ = info -> lower_ [index] - *brPts;
219  } else
220  */
221 
222  if (pseudoMultType_ == PROJECTDIST) {
223  downEstimate_ = brDist [0];
224  upEstimate_ = brDist [1];
225  } else setEstimates (info, NULL, brPts);
226 
228  if (jnlst_ -> ProduceOutput (J_MOREMATRIX, J_BRANCHING)) {
229  printf ("brpts for "); reference_ -> print ();
230  if (reference_ -> Image ()) {printf (" := "); reference_ -> Image () -> print ();}
231  printf (" is on "); brVar -> print ();
232  printf (" @ %.12g [%.12g,%.12g]\n", *brPts,
233  problem_ -> Lb (brVar -> Index ()),
234  problem_ -> Ub (brVar -> Index ()));
235 
236  if (brVar) {
237 
238  if (improv <= COUENNE_EPS) {
239  printf ("### warning, infeas = %g for ", improv);
240  reference_ -> print ();
241  if (reference_ -> Image ()) {printf (":="); reference_ -> Image () -> print ();}
242  printf ("\n");
243  }
244 
245  int index = brVar -> Index ();
246  if (info -> lower_ [index] >=
247  info -> upper_ [index] - COUENNE_EPS) {
248  printf ("### warning, tiny bounding box [%g,%g] for x_%d\n",
249  info -> lower_ [index],
250  info -> upper_ [index], index);
251  }
252  }
253  }
254 
255  // create branching object ///////////////////////////////////////
256  OsiBranchingObject *brObj = new CouenneBranchingObject
257  (si, this, jnlst_, cutGen_, problem_, brVar, way, *brPts, doFBBT_, doConvCuts_);
258 
259  problem_ -> domain () -> pop (); // Couenne discards current point
260 
261  if (brPts) free (brPts);
262  if (brDist) free (brDist);
263 
264  return brObj;
265 }
266 
267 
270  const OsiBranchingInformation *info) const {
271 
272  CouNumber curAlpha = alpha_;
273 
274 #if 1
275  if (info) {
276 
277  // adaptive scheme: make LP point count more when gap approaches zero
278  int objInd = problem_ -> Obj (0) -> Body () -> Index ();
279 
280  double
281  lb = objInd >= 0 ? info -> lower_ [objInd] : problem_ -> Obj (0) -> Body () -> Value (),
282  ub = problem_ -> getCutOff (),
283  currentGap =
284  (ub > COUENNE_INFINITY / 10 ||
285  lb < -Couenne_large_bound / 10) ? 1.e3 :
286  fabs (ub - lb) / (1.e-3 + CoinMin (fabs (ub), fabs (lb)));
287 
288 #if 1
289  if (currentGap < 1e-3) {
290 
291  currentGap *= 1e3;
292 
293  assert ((currentGap >= 0.) &&
294  (currentGap <= 1.));
295 
296  curAlpha = currentGap * alpha_ + (1 - currentGap);
297  }
298 #else
299  // make curAlpha closer to 1 by adding remaining (1-alpha_)
300  // weighted inversely proportional to gap
301  curAlpha += (1 - alpha_) / (1. + currentGap);
302 #endif
303 
304  // printf ("using %g rather than %g. cutoff %g, lb %g, gap %g\n",
305  // curAlpha, alpha_,
306  // problem_ -> getCutOff (),
307  // lb, currentGap);
308  }
309 #endif
310 
311  if (u < l + COUENNE_EPS)
312  return (0.5 * (l + u));
313 
314  if (x<l) x = l;
315  else if (x>u) x = u;
316 
317  if (l < -large_bound)
318  if (u > COUENNE_EPS) return 0.; // ]-inf,+inf[
319  else return CoinMax ((l+u)/2, (AGGR_MUL * (-1. + u))); // ]-inf,u]
320  else
321  if (u > large_bound) // [l,+inf[
322  if (l < - COUENNE_EPS) return 0.;
323  else return CoinMin ((l+u)/2, (AGGR_MUL * (1. + l)));
324  else { // [l,u]
325 
326  CouNumber point = curAlpha * x + (1. - curAlpha) * (l + u) / 2.;
327 
328  if ((point-l) / (u-l) < closeToBounds) point = l + (u-l) * closeToBounds;
329  else if ((u-point) / (u-l) < closeToBounds) point = u + (l-u) * closeToBounds;
330 
331  return point;
332  }
333 }
334 
335 
338  const OsiBranchingInformation *info) const {
339 
340  if ((l < -COUENNE_EPS) &&
341  (u > COUENNE_EPS) &&
342  (-l/u >= THRES_ZERO_SYMM) &&
343  (-u/l >= THRES_ZERO_SYMM))
344  return 0.; // this happens when [l,u] is quite symmetrical w.r.t. 0
345 
346  CouNumber width = lp_clamp_ * (u-l);
347 
348  switch (strategy_) {
349 
350  case CouenneObject::MIN_AREA: return maxHeight (ft, l, u);
351  case CouenneObject::BALANCED: return minMaxDelta (ft, l, u);
352  case CouenneObject::LP_CLAMPED: return CoinMax (l + width, CoinMin (x0, u - width));
353  case CouenneObject::LP_CENTRAL: return ((x0 < l + width) || (x0 > u - width)) ? (l+u)/2 : x0;
354  case CouenneObject::MID_INTERVAL: return midInterval (x0, l, u, info);
355 
356  default:
357  printf ("Couenne: unknown branching point selection strategy\n");
358  exit (-1);
359  }
360 }
361 
362 
364 double CouenneObject::infeasibility (const OsiBranchingInformation *info, int &way) const {
365 
366  if (strategy_ == NO_BRANCH) {
368  return 0;
369  }
370 
371  problem_ -> domain () -> push
372  (problem_ -> nVars (),
373  info -> solution_,
374  info -> lower_,
375  info -> upper_,
376  false);
377 
378  double retval = checkInfeasibility (info);
379 
380  problem_ -> domain () -> pop ();
381 
382  bool isInt = reference_ -> isInteger ();
383 
384  int refInd = reference_ -> Index ();
385  double point = info -> solution_ [refInd];
386 
388 
389  if (isInt) {
390  CouNumber intInfeas = intInfeasibility (point, info -> lower_ [refInd], info -> upper_ [refInd]);
391 
392  if (retval < intInfeas) {
393  if (downEstimate_ < point - floor (point)) downEstimate_ = point - floor (point);
394  if (upEstimate_ < ceil (point) - point) upEstimate_ = ceil (point) - point;
395  retval = intInfeas;
396  }
397  }
398  else upEstimate_ = downEstimate_ = retval;
399  }
400  else setEstimates (info, &retval, NULL);
401 
402  return (isInt ?
403  CoinMax (retval, intInfeasibility (point, info -> lower_ [refInd], info -> upper_ [refInd])) :
404  retval);
405 }
406 
407 
411 double CouenneObject::checkInfeasibility (const OsiBranchingInformation *info) const {
412 
413  int refInd = reference_ -> Index ();
414 
415  if (reference_ -> Type () == VAR)
416  return (reference_ -> isInteger ()) ?
417  intInfeasibility (info -> solution_ [refInd],
418  info -> lower_ [refInd],
419  info -> upper_ [refInd]) : 0.;
420 
421  double
422  vval = info -> solution_ [reference_ -> Index ()],
423  fval = (*(reference_ -> Image ())) (),
424  denom = CoinMax (1., reference_ -> Image () -> gradientNorm (info -> solution_));
425 
426  // check if fval is a number (happens with e.g. w13 = w12/w5 and w5=0, see test/harker.nl)
427  if (CoinIsnan (fval)) {
428  fval = vval + 1.;
429  denom = 1.;
430  }
431 
432  if (fabs (fval) > COUENNE_INFINITY)
433  fval = COUENNE_INFINITY;
434 
435  double
436  retval =
437  ((reference_ -> sign () == expression::AUX_GEQ) && (vval >= fval)) ? 0. :
438  ((reference_ -> sign () == expression::AUX_LEQ) && (vval <= fval)) ? 0. : fabs (vval - fval),
439 
440  ratio = (CoinMax (1., fabs (vval)) /
441  CoinMax (1., fabs (fval)));
442 
443  //jnlst_ -> Printf (J_DETAILED, J_BRANCHING, "checkinf --> v=%e f=%e den=%e ret=%e ratio=%e\n", vval, fval, denom, retval, ratio);
444 
445  if ((ratio < 2) &&
446  (ratio > .5) &&
447  ((retval /= denom) < CoinMin (COUENNE_EPS, feas_tolerance_)))
448  retval = 0.;
449 
450  if (//(retval > 0.) &&
451  (jnlst_ -> ProduceOutput (J_DETAILED, J_BRANCHING))) {
452 
453  printf (" infeas %g: ", retval);
454  reference_ -> print ();
455  if (reference_ -> Image ()) {printf (" := "); reference_ -> Image () -> print ();}
456  printf ("\n");
457  }
458 
459  // Need to allow infeasibility for a variable without making the
460  // whole problem infeasible with an infeasibility = 1e+50. Check
461  // BonChooseVariable.cpp:382
462 
463  if (retval > 1.e40)
464  retval = 1.e20;
465 
466  return (reference_ -> isInteger ()) ?
467  CoinMax (retval, intInfeasibility (info -> solution_ [refInd],
468  info -> lower_ [refInd],
469  info -> upper_ [refInd])) :
470  retval;
471 }
472 
473 
476 
477  if (!base) return;
478 
479  std::string s;
480 
481  base -> options () -> GetStringValue ("pseudocost_mult", s, "couenne.");
482 
483  if (s == "interval_lp") pseudoMultType_ = INTERVAL_LP;
484  else if (s == "interval_lp_rev") pseudoMultType_ = INTERVAL_LP_REV;
485  else if (s == "interval_br") pseudoMultType_ = INTERVAL_BR;
486  else if (s == "interval_br_rev") pseudoMultType_ = INTERVAL_BR_REV;
487  else if (s == "infeasibility") pseudoMultType_ = INFEASIBILITY;
488  else if (s == "projectDist") pseudoMultType_ = PROJECTDIST;
489 
490  base -> options() -> GetStringValue ("branch_fbbt", s, "couenne."); doFBBT_ = (s=="yes");
491  base -> options() -> GetStringValue ("branch_conv_cuts", s, "couenne."); doConvCuts_ = (s=="yes");
492 
493  base -> options() -> GetNumericValue ("feas_tolerance", feas_tolerance_, "couenne.");
494 
495  std::string brtype;
496  base -> options () -> GetStringValue ("branch_pt_select", brtype, "couenne.");
497 
498  if (brtype == "balanced") strategy_ = BALANCED;
499  else if (brtype == "lp-clamped") strategy_ = LP_CLAMPED;
500  else if (brtype == "lp-central") strategy_ = LP_CENTRAL;
501  else if (brtype == "min-area") strategy_ = MIN_AREA;
502  else if (brtype == "no-branch") strategy_ = NO_BRANCH;
503  else if (brtype == "mid-point") {
505  base -> options () -> GetNumericValue ("branch_midpoint_alpha", alpha_, "couenne.");
506  }
507 
508  if (strategy_ == LP_CLAMPED ||
510  base -> options () -> GetNumericValue ("branch_lp_clamp", lp_clamp_, "couenne.");
511 
512  // accept options for branching rules specific to each operator
513  if (reference_ && reference_ -> Type () == AUX) {
514 
515  std::string br_operator = "";
516 
517  switch (reference_ -> Image () -> code ()) {
518 
519  case COU_EXPRPOW: {
520 
521  // begin with default value in case specific exponent are not given
522  base -> options () -> GetStringValue ("branch_pt_select_pow", brtype, "couenne.");
523 
524  CouNumber expon = reference_ -> Image () -> ArgList () [1] -> Value ();
525 
526  if (fabs (expon - 2.) < COUENNE_EPS) br_operator = "sqr";
527  else if (fabs (expon - 3.) < COUENNE_EPS) br_operator = "cube";
528  else if (expon < 0.) br_operator = "negpow";
529  else br_operator = "pow";
530  } break;
531 
532  case COU_EXPRMUL:
533  br_operator = (reference_ -> Image () -> ArgList () [0] -> Index () !=
534  reference_ -> Image () -> ArgList () [1] -> Index ()) ?
535  "prod" : "sqr";
536  break;
537  case COU_EXPRINV: br_operator = "negpow"; break;
538  case COU_EXPRDIV: br_operator = "div"; break;
539  case COU_EXPRLOG: br_operator = "log"; break;
540  case COU_EXPREXP: br_operator = "exp"; break;
541  case COU_EXPRSIN:
542  case COU_EXPRCOS: br_operator = "trig"; break;
543  default: break;
544  }
545 
546  if (br_operator != "") {
547  // read option
548  char select [40], sel_clamp [40];
549  double lp_clamp_fun = default_clamp;
550  sprintf (select, "branch_pt_select_%s", br_operator.c_str ());
551  sprintf (sel_clamp, "branch_lp_clamp_%s", br_operator.c_str ());
552  base -> options () -> GetStringValue (select, brtype, "couenne.");
553  base -> options () -> GetNumericValue (sel_clamp, lp_clamp_fun, "couenne.");
554 
555  if (lp_clamp_fun != default_clamp)
556  lp_clamp_ = lp_clamp_fun;
557 
558  if (brtype == "balanced") strategy_ = BALANCED;
559  else if (brtype == "lp-clamped") strategy_ = LP_CLAMPED;
560  else if (brtype == "lp-central") strategy_ = LP_CENTRAL;
561  else if (brtype == "min-area") strategy_ = MIN_AREA;
562  else if (brtype == "no-branch") strategy_ = NO_BRANCH;
563  else if (brtype == "mid-point") {
565  double alpha_fun = default_alpha;
566  base -> options () -> GetNumericValue ("branch_midpoint_alpha", alpha_fun, "couenne.");
567  if (alpha_fun != default_alpha)
568  alpha_ = alpha_fun;
569  }
570  }
571  }
572 }
573 
574 
576 void CouenneObject::setEstimates (const OsiBranchingInformation *info,
577  CouNumber *infeasibility,
578  CouNumber *brpoint) const {
579 
580  int index = reference_ -> Index ();
581 
582  //bool isInteger = reference_ -> isInteger ();
583 
584  CouNumber
585  *up = &upEstimate_,
586  *down = &downEstimate_,
587  point = 0.,
588  lower = info -> lower_ [index],
589  upper = info -> upper_ [index];
590 
592  //
593  // these rules invert the interval, so we just flip the pointers
594 
595  if ((pseudoMultType_ == INTERVAL_LP_REV) ||
597 
598  up = &downEstimate_;
599  down = &upEstimate_;
600  }
601 
603  if (info &&
606 
607  point = info -> solution_ [index];
608 
609  else if (brpoint &&
612 
613  point = *brpoint;
614 
615  //printf ("point = %g [%s]\n", point, reference_ -> isInteger () ? "int" : "frac");
616 
617  // now move it away from the bounds, unless this is an integer variable
618 
619  //if (!isInteger)
620  point = midInterval (point, lower, upper, info);
621 
622  //printf ("point = %g\n", point);
623 
624  if ((lower > -COUENNE_INFINITY) &&
625  (upper < COUENNE_INFINITY)) {
626 
627  CouNumber delta = closeToBounds * (upper - lower);
628 
629  if (point < lower + delta)
630  point = lower + delta;
631  else if (point > upper - delta)
632  point = upper - delta;
633  }
634 
636  switch (pseudoMultType_) {
637 
638  case INFEASIBILITY:
639 
640  if (infeasibility)
642 
643  break;
644 
645  case INTERVAL_LP:
646  case INTERVAL_LP_REV:
647  case INTERVAL_BR:
648  case INTERVAL_BR_REV:
649  assert (info);
650  *up = CoinMin (max_pseudocost, COUENNE_EPS + fabs (upper - point));
651  *down = CoinMin (max_pseudocost, COUENNE_EPS + fabs ( point - lower));
652  break;
653 
654  case PROJECTDIST: // taken care of in selectBranch procedure
655  break;
656 
657  default:
658  printf ("Couenne: invalid estimate setting procedure\n");
659  exit (-1);
660  }
661 
662  /*if (downEstimate_ <= 0.0 || upEstimate_ <= 0.0)
663  printf ("%g [%g,%g] ---> [%g,%g]\n",
664  point,
665  lower,
666  upper,
667  downEstimate_, upEstimate_);*/
668 
669  /*if (reference_ -> isInteger ()) {
670 
671  CouNumber
672  fracDn = point - floor (point),
673  fracUp = ceil (point) - point;
674 
675  if (downEstimate_ < fracDn) downEstimate_ = fracDn;
676  if (upEstimate_ < fracUp) upEstimate_ = fracUp;
677  }*/
678 
679  assert (downEstimate_ > 0. &&
680  upEstimate_ > 0.);
681 }
#define THRES_ZERO_SYMM
Cut Generator for linear convexifications.
const double large_bound
if |branching point| &gt; this, change it
CouenneObject()
empty constructor (for unused objects)
const CouNumber feas_tolerance_default
void fint fint fint real fint real real real real real real real real real fint real fint fint fint real fint fint fint fint * info
OsiObject for auxiliary variables $w=f(x)$.
CouNumber alpha_
Combination parameter for the mid-point branching point selection strategy.
virtual OsiBranchingObject * createBranch(OsiSolverInterface *, const OsiBranchingInformation *, int) const
create CouenneBranchingObject or CouenneThreeWayBranchObj based on this object
#define AGGR_MUL
exprVar * reference_
The (auxiliary) variable this branching object refers to.
const double Couenne_large_bound
used to declare LP unbounded
&quot;Spatial&quot; branching object.
void setEstimates(const OsiBranchingInformation *info, CouNumber *infeasibility, CouNumber *brpt) const
set up/down estimates based on branching information
enum brSelStrat strategy_
Branching point selection strategy.
static const double init_estimate
const Ipopt::EJournalCategory J_BRANCHING(Ipopt::J_USER1)
bool doFBBT_
shall we do Feasibility based Bound Tightening (FBBT) at branching?
CouNumber feas_tolerance_
feasibility tolerance (equal to that of CouenneProblem)
double downEstimate_
down estimate (to be used in pseudocost)
int up
Definition: OSdtoa.cpp:1817
CouenneProblem * problem_
pointer to Couenne problem
CouNumber minMaxDelta(funtriplet *ft, CouNumber lb, CouNumber ub)
Definition: minMaxDelta.cpp:49
void fint fint fint real fint real real real real real real real real real * e
const CouNumber default_alpha
ULong * x0
Definition: OSdtoa.cpp:1776
void setParameters(Bonmin::BabSetupBase *base)
set object parameters by reading from command line
A class to have all elements necessary to setup a branch-and-bound.
static double ratio(Bigint *a, Bigint *b)
Definition: OSdtoa.cpp:1460
bool doConvCuts_
shall we add convexification cuts at branching?
virtual double intInfeasibility(double value, double lb, double ub) const
integer infeasibility: min {value - floor(value), ceil(value) - value}
Class for MINLP problems with symbolic information.
const CouNumber closeToBounds
CouNumber getBrPoint(funtriplet *ft, CouNumber x0, CouNumber l, CouNumber u, const OsiBranchingInformation *info=NULL) const
pick branching point based on current strategy
void fint fint fint fint fint fint fint fint fint fint real real real real real real real real * s
#define COUENNE_EPS
const CouNumber max_pseudocost
double CouNumber
main number type in Couenne
enum pseudocostMult pseudoMultType_
multiplier type for pseudocost
double upEstimate_
up estimate (to be used in pseudocost)
CouNumber midInterval(CouNumber x, CouNumber l, CouNumber u, const OsiBranchingInformation *info=NULL) const
returns a point &quot;inside enough&quot; a given interval, or x if it already is.
#define COUENNE_INFINITY
variable-type operator
CouenneCutGenerator * cutGen_
pointer to cut generator (not necessary, can be NULL)
CouNumber lp_clamp_
Defines safe interval percentage for using LP point as a branching point.
Expression base class.
const CouNumber default_clamp
JnlstPtr jnlst_
SmartPointer to the Journalist.
virtual double infeasibility(const OsiBranchingInformation *info, int &way) const
compute infeasibility of this variable, |w - f(x)| (where w is the auxiliary variable defined as w = ...
virtual double checkInfeasibility(const OsiBranchingInformation *info) const
compute infeasibility of this variable, |w - f(x)|, where w is the auxiliary variable defined as w = ...
CouNumber maxHeight(funtriplet *ft, CouNumber lb, CouNumber ub)
Definition: minMaxDelta.cpp:86
void fint fint fint real fint real * x
bool isInteger(CouNumber x)
is this number integer?