Changeset 351


Ignore:
Timestamp:
Jun 5, 2010 9:23:13 AM (10 years ago)
Author:
pbelotti
Message:

merging changeset 349:350 (fixing strange behavior in exprPow with large bounds)

Location:
stable/0.3/Couenne/src/convex/operators
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable/0.3/Couenne/src/convex/operators

  • stable/0.3/Couenne/src/convex/operators/conv-exprExp.cpp

    r217 r351  
    6060  }
    6161
     62  // no need to continue if this is an expression of the form y<=e^x
     63  // (the upper segment is needed only)
     64  if (sign == expression::AUX_LEQ)
     65    return;
     66
    6267  // add tangent points: first choose sampling points
    6368
  • stable/0.3/Couenne/src/convex/operators/conv-exprPow-envelope.cpp

    r217 r351  
    3232  // orthogonal with line through current- and tangent point)
    3333
    34   if (!(cg -> isFirst ())) {
     34  powertriplet pt (k);
    3535
    36     powertriplet pt (k);
     36  if (!(cg -> isFirst ()))
    3737    x = powNewton (x, y, &pt);
    38   }
    3938
    4039  if      (x<l) x=l;
     
    4645            step     = (1 + log (1. + (double) (cg -> nSamples ()))) * powThres / COU_MAX_COEFF;
    4746
     47  // If the bounds are too large, the linearization cuts might have
     48  // large coefficients. To prevent that, Couenne used to set very
     49  // small fictitious bounds, resulting in
     50  //
     51  // 1) still valid cuts, but
     52  // 2) a very abrupt change in their coefficients;
     53  // 3) cuts that may result in an LP solution far away from x (this
     54  // behavior recalls that of bundle methods for NDO);
     55  // 4) a non-exact linearization at the bounds (in theory, necessary
     56  // for convergence...).
     57  //
     58  // New values for l and u, if necessary, are therefore set to the
     59  // maximum bounds if l and/or u are beyond them.
     60  //
     61  // Thanks to Sergey for pointing this out.
     62
    4863  if (l < - powThres + 1) {
    49     l = x - step;
    50     if (u > powThres - 1)
    51       u = x + step;
     64    l = - powThres + 1; // keeps bounds reasonably large
     65    //l = x - step;
     66    if (u > powThres - 1) {
     67      u = powThres - 1;
     68    //u = x + step;
     69    }
    5270  } else
    53     if (u > powThres - 1)
    54       u = x + step;
    55 
    56   powertriplet pt (k);
     71    if (u > powThres - 1) {
     72      u = powThres - 1;
     73      //u = x + step;
     74    }
    5775
    5876  // convex envelope
Note: See TracChangeset for help on using the changeset viewer.