Changeset 296


Ignore:
Timestamp:
Feb 13, 2010 9:08:07 AM (11 years ago)
Author:
pbelotti
Message:

bilinear: added check for points in bounding box

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/convex/operators/exprMul-upperHull.cpp

    r290 r296  
    3737#ifdef DEBUG
    3838  printf ("entering points: ===================================================\n");
    39   printf ("x: %9g\t[%9g\t%9g]\n", x0, xl, xu);
    40   printf ("y: %9g\t[%9g\t%9g]\n", y0, yl, yu);
    41   printf ("w: %9g\t[%9g\t%9g]\n", w0, wl, wu);
     39  printf ("x [%d]: %9g\t[%9g\t%9g]\n", xi, x0, xl, xu);
     40  printf ("y [%d]: %9g\t[%9g\t%9g]\n", yi, y0, yl, yu);
     41  printf ("w [%d]: %9g\t[%9g\t%9g]\n", wi, w0, wl, wu);
    4242#endif
    4343
    4444  // Preprocess to reduce everything to a first-orthant problem
    4545
    46   if ((wl < 0) && (wu > 0)) // nothing to tighten
     46  if ((wl <  0 && wu > 0)) // nothing to tighten
    4747    return;
     48
     49  // project back into bounding box
     50  if (x0 < xl) x0 = xl;  if (x0 > xu) x0 = xu;
     51  if (y0 < yl) y0 = yl;  if (y0 > yu) y0 = yu;
    4852
    4953  if (wl >= 0) {
     
    142146  // || flipY)
    143147
    144   //printf ("there will be cuts!\n");
    145 
    146148  CouNumber
    147149    cX, cY, cW, c0,
     
    242244  } else {
    243245
     246#ifdef DEBUG
    244247    printf ("points are in a weird position:\n");
    245248    printf ("lower: %9g\t%9g\tprod %9g\n", xLow, yLow, xLow*yLow);
    246249    printf ("upper: %9g\t%9g\tprod %9g\n", xUpp, yUpp, xUpp*yUpp);
     250#endif
    247251
    248252    return;
Note: See TracChangeset for help on using the changeset viewer.