Changeset 140


Ignore:
Timestamp:
Jun 3, 2009 12:00:37 AM (12 years ago)
Author:
pbelotti
Message:

merged from trunk:139 (fix in conv-exprPow-getBounds.cpp)

Location:
stable/0.1/Couenne/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • stable/0.1/Couenne/src/convex/operators/conv-exprPow-getBounds.cpp

    • Property svn:keywords set to Id
    r1 r140  
    1 /*
     1/* $Id$
     2 *
    23 * Name:    conv-exprPow-getBounds.cpp
    34 * Author:  Pietro Belotti
    45 * Purpose: method to get lower and upper bounds of a power x^y
    56 *
    6  * (C) Carnegie-Mellon University, 2006.
     7 * (C) Carnegie-Mellon University, 2006-09.
    78 * This file is licensed under the Common Public License (CPL)
    89 */
     
    7980
    8081      if (expon > 0)
    81         all [1] = new exprPow (new exprClone (lbbase), new exprConst (expon));
     82        all    [1] = new exprPow (new exprClone (lbbase), new exprConst (expon));
    8283      else all [1] = new exprPow (new exprClone (ubbase), new exprConst (expon));
    8384
     
    121122        ub = new exprMax (new exprPow (new exprClone (lbbase), new exprConst (expon)),
    122123                          new exprPow (new exprClone (ubbase), new exprConst (expon)));
    123       } else {
     124
     125      } else { // from this point on, expon < 0
    124126
    125127        expression **alu = new expression * [6];
     
    129131        alu [4] = new exprClone (ubbase);
    130132
    131         if ((expon > 0) || ((isInt || isInvInt) && !(rndexp % 2)))
    132           alu    [1] = new exprPow (new exprClone (ubbase), new exprConst (expon));
    133         else alu [1] = new exprPow (new exprClone (lbbase), new exprConst (expon));
     133        //if ((isInt || isInvInt) && !(rndexp % 2))
     134        //alu    [1] = new exprPow (new exprClone (ubbase), new exprConst (expon));
     135        //else
     136
     137        // if negative exponent and base has nonnegative lower bound,
     138        // the upper bound can only be lb^k
     139        alu [1] = new exprPow (new exprClone (lbbase), new exprConst (expon));
    134140
    135141        // alu [3] is upper bound when lbbase <= 0 <= ubbase
    136142
    137         if (expon < - COUENNE_EPS)
    138           alu [3] = new exprConst (COUENNE_INFINITY);
    139         else if (isInt && !(rndexp % 2))
    140           alu [3] = new exprPow (new exprMax (new exprClone (lbbase), new exprClone (ubbase)),
    141                                  new exprConst (expon));
    142         else alu [3] = new exprPow (new exprClone (ubbase), new exprConst (expon));
     143        //if (expon < - COUENNE_EPS)
     144        alu [3] = new exprConst (COUENNE_INFINITY);
     145        //else if (isInt && !(rndexp % 2))
     146        //alu [3] = new exprPow (new exprMax (new exprClone (lbbase), new exprClone (ubbase)),
     147        //new exprConst (expon));
     148        //else alu [3] = new exprPow (new exprClone (ubbase), new exprConst (expon));
    143149
    144150        // alu [5] is the upper bound value when lbbase <= ubbase <= 0
    145151
    146         if (expon > COUENNE_EPS) {
     152        /*if (expon > COUENNE_EPS) {
    147153
    148154          if (isInt && !(rndexp % 2))
     
    150156          else alu [5] = new exprConst (0.);
    151157        }
    152         else {
    153           if (isInt || isInvInt)
    154             alu [5] = new exprPow (new exprClone(ubbase), new exprConst(expon));
    155           else alu [5] = new exprConst (COUENNE_INFINITY);
    156         }
     158        else {*/
     159        if (isInt || isInvInt)
     160          alu [5] = new exprPow (new exprClone (ubbase), new exprConst (expon));
     161        else alu [5] = new exprConst (COUENNE_INFINITY);
     162          //}
    157163
    158164        ub = new exprMin (alu, 6);
  • stable/0.1/Couenne/src/main/BonCouenneInterface.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.1/Couenne/src/problem/CouenneProblem.hpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.1/Couenne/src/problem/CouenneSolverInterface.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.1/Couenne/src/problem/getIntegerCandidate.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.1/Couenne/src/readnl/invmap.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.1/Couenne/src/readnl/nl2e.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.1/Couenne/src/readnl/readnl.cpp

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.