Ignore:
Timestamp:
Apr 27, 2007 3:39:58 PM (13 years ago)
Author:
pbelotti
Message:

limit power upper/lower bounds to get reasonable coefficients

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Couenne/Couenne/src/convex/operators/conv-exprInv.cpp

    r476 r520  
    4646
    4747
    48 // derivative of inv (x)
    49 
    50 inline CouNumber oppInvSqr (register CouNumber x)
    51 {return (- inv (x*x));}
    52 
    53 
    5448#define MIN_DENOMINATOR 1e-10
    5549
     
    7973  aux -> getBounds (wle, wue);
    8074
    81   expression *xe = argument_;
    82 
    83   CouNumber x = (*xe)  ();
     75  CouNumber x;
    8476
    8577  int w_ind = aux       -> Index (),
     
    10799  }
    108100
    109   int sign = (l > 0) ? +1 : -1;
    110 
    111101  // bound
    112 
    113   cg -> addEnvelope (cs, sign, inv, oppInvSqr, w_ind, x_ind, x, l, u);
     102  cg -> addEnvelope
     103    (cs, (l > 0) ? +1 : -1,
     104     inv, oppInvSqr, w_ind, x_ind,
     105     (cg -> isFirst ()) ?
     106       // place it somewhere in the interval (we won't care)
     107       ((l > COUENNE_EPS) ? l : u) :
     108       // not first call, gotta replace it where it gives deepest cut
     109       powNewton ((*argument_) (), (*aux) (), inv, oppInvSqr, inv_dblprime),
     110     l, u);
    114111
    115112  delete xle;
Note: See TracChangeset for help on using the changeset viewer.