Ignore:
Timestamp:
May 7, 2007 1:44:28 PM (13 years ago)
Author:
pbelotti
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
Added
Removed
  • branches/Couenne/Couenne/src/convex/operators/conv-exprLog.cpp

    r525 r534  
    2929  argument_ -> getBounds (le, ue);
    3030
    31   CouNumber x = (cg -> isFirst ()) ?
    32                  1 : powNewton ((*argument_) (), (*aux) (), log, inv, oppInvSqr),
    33             l = (*le) (),
     31  CouNumber l = (*le) (),
    3432            u = (*ue) ();
    3533
    3634  int w_ind = aux       -> Index ();
    3735  int x_ind = argument_ -> Index ();
     36
     37  // if bounds are very close, convexify with a single line
     38
     39  if ((fabs (u - l) < COUENNE_EPS) && (l > COUENNE_EPS)) {
     40
     41    CouNumber x0 = 0.5 * (u+l);
     42    cg -> createCut (cs, log (x0) - 1, 0,
     43                     w_ind, 1., x_ind, - 1/x0);
     44    return;
     45  }
     46
     47  CouNumber x = (cg -> isFirst ()) ?
     48                 1 : powNewton ((*argument_) (), (*aux) (), log, inv, oppInvSqr);
    3849
    3950  // fix lower bound
Note: See TracChangeset for help on using the changeset viewer.