# Changeset 534 for branches/Couenne/Couenne/src/branch/CouenneBranchingObject.cpp

Ignore:
Timestamp:
May 7, 2007 1:44:28 PM (13 years ago)
Message:

moved include files to make them doxygenable. Introduced three-way branching, with fixed intervals for now. Added check for small bound interval within all generateCuts()

File:
1 edited

### Legend:

Unmodified
 r531 #include /// make branching point $\alpha$ away from current point: /// bp = alpha * current + (1-alpha) * midpoint CouNumber CouenneBranchingObject::alpha_ = 0.5; CouNumber CouenneBranchingObject::alpha_ = 0.25; int index = reference_ -> Index (); if (index < 0) printf ("Couenne: Warning, CouenneBranchingObject has negative reference's index\n"); long double x = expression::Variable (index),   // current solution else if (x>u) x = u; if ((x > l + COUENNE_EPS) && (x < u - COUENNE_EPS))      // x is not at the boundary // This two-way branching rule is only applied when both lower and // upper bound are finite. Otherwise, a CouenneThreeWayBranchObj is // used (see CouenneThreeWayBranchObj.hpp). // // The rule is as follows: // // - if x is well inside the interval (both bounds are infinite or // there is a difference of at least COU_NEAR_BOUND), set // value_ to x; // // - otherwise, try to get far from bounds by setting value_ to a // convex combination of current and midpoint // // TODO: consider branching value that maximizes distance from // current point (how?) if (fabs (u-l) < COUENNE_EPS) printf ("Warning, interval is really tiny\n"); if ((x-l < COUENNE_NEAR_BOUND) || (u-x < COUENNE_NEAR_BOUND)) value_ = alpha * x + (1. - alpha) * (l + u) / 2.; else value_ = x; /* if ((x > l + COUENNE_NEAR_BOUND) && (x < u - COUENNE_NEAR_BOUND))      // x is not at the boundary value_ = x; else // current point is at one of the bounds if ((l > - COUENNE_INFINITY + 1) && (u <   COUENNE_INFINITY - 1)) if ((l > - COUENNE_INFINITY) && (u <   COUENNE_INFINITY)) // finite bounds, apply midpoint rule value_ = alpha * x + (1. - alpha) * (l + u) / 2.; if (fabs (x-l) < COUENNE_EPS) value_ = l + (1+fabs (l)) / 2.; else                          value_ = u - (1+fabs (u)) / 2.; */ if (0) { } } /** \brief Execute the actions required to branch, as specified by the int way = (!branchIndex_) ? firstBranch_ : !firstBranch_, ind = reference_ -> Index (); CouNumber l = solver -> getColLower () [ind], u = solver -> getColUpper () [ind];