Ignore:
Timestamp:
May 31, 2007 4:11:46 PM (12 years ago)
Author:
pbelotti
Message:

fixed bug in setting branching point

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/src/branch/CouenneObject.cpp

    r557 r558  
    6363  CouNumber delta = fabs (var - expr);
    6464
    65   //  CouNumber l  = info -> lower_ [index],
    66   //            u  = info -> upper_ [index];
    67   /*  if (0)
    68     if ((delta > COUENNE_EPS) &&
    69         ((fabs (u-l) < COUENNE_EPS) ||
    70         ((mymin (fabs (l), fabs (u)) > COUENNE_EPS) &&
    71          (fabs (u-l) / mymax (fabs (l), fabs (u)) < COUENNE_EPS)))) {
    72       //      ((mymin (fabs (lr), fabs (ur)) > COUENNE_EPS) &&
    73       //       (fabs (ur-lr) / mymax (fabs (lr), fabs (ur)) < COUENNE_EPS)))
    74 
    75       printf (". Inf: = |%.4f - %.4f| = %.4e. w [%.3f,%.3f], x [%.3f,%.3f] = %.4e ",  ////[%.2f,%.2f]
    76               var, expr, fabs (var - expr),
    77               info -> lower_ [reference_ -> Index ()],
    78               info -> upper_ [reference_ -> Index ()],
    79               l, u, u-l);
    80       reference_             -> print (std::cout); std::cout << " = ";
    81       reference_ -> Image () -> print (std::cout);
    82       printf ("\n");
    83     }
    84   */
    85   //printf (" delta=%.9f,l=%.9f,u=%.9f ", delta, l, u);
    86 
    8765  /// avoid branching on (relatively) small deltas
    8866  if (delta < COUENNE_EPS)
    89     /*||
    90       (fabs (u-l) < COUENNE_EPS) ||
    91       ((mymin (fabs (l), fabs (u)) > COUENNE_EPS) &&
    92       (fabs (u-l) / mymax (fabs (l), fabs (u)) < COUENNE_EPS)))*/
    93     //      ((mymin (fabs (lr), fabs (ur)) > COUENNE_EPS) &&
    94     //       (fabs (ur-lr) / mymax (fabs (lr), fabs (ur)) < COUENNE_EPS)))
    9567    delta = 0.;
    9668
     
    131103
    132104  if (0) {
    133 
    134     printf ("Inf |%+.4e - %+.4e| = %+.4e  %+.4e way %d, ind %d",  ////[%.2f,%.2f]
     105    printf ("Inf |%+g - %+g| = %+g  (delta=%+g) way %d, ind %d. ",  ////[%.2f,%.2f]
    135106            var, expr,
    136107            //      expression::Lbound (reference_ -> Index ()),
     
    214185                                                 int way) const {
    215186
    216   // way has suggestion from CouenneObject::infeasibility()
    217   // Well, not exactly... it seems
    218 
    219187  bool isint = reference_ -> isInteger ();
     188
     189  // way has suggestion from CouenneObject::infeasibility(), but not
     190  // as set in infeasibility, so we use the one stored in member
     191  // whichWay_
    220192
    221193  way = whichWay_;
     
    268240  int index;
    269241
    270   // Create a two- or three-way branching object according to
    271   // finiteness of the intervals. For now only check if argument
    272   // bounds are finite.
    273 
    274   // TODO: check if function is finite within the interval (if so,
    275   // two-way, if not, three-way). Could be operator-dependent, that
    276   // is,
    277   //
    278   // return reference_ -> BranchObject (brVar_);
     242  // Create a two-way branching object according to finiteness of the
     243  // intervals. For now only check if argument bounds are finite.
    279244
    280245  int ref_ind = reference_ -> Index ();
Note: See TracChangeset for help on using the changeset viewer.