Changeset 253


Ignore:
Timestamp:
Aug 26, 2009 12:07:48 AM (12 years ago)
Author:
pbelotti
Message:

merged changeset 252 from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/0.2/Couenne/src/standardize/constrStandardize.cpp

    r159 r253  
    55 * Purpose: standardization of constraints
    66 *
    7  * (C) Carnegie-Mellon University, 2007.
     7 * (C) Carnegie-Mellon University, 2007-09.
    88 * This file is licensed under the Common Public License (CPL)
    99 */
     
    5353
    5454    if (wind >= 0) { // this IS the definition of an auxiliary variable w = f(x)
     55
     56      // first, simplify expression (you never know)
     57
     58      expression *restSimple = rest -> simplify ();
     59
     60      if (restSimple) {
     61        delete rest;
     62        rest = restSimple;
     63      }
     64
     65      // second, if this is a constraint of the form x=k, reset x's
     66      // bounds and do nothing else
     67
     68      if (rest -> code () == COU_EXPRCONST) {
     69
     70        p -> Var (wind) -> lb () =
     71        p -> Var (wind) -> ub () = rest -> Value ();
     72
     73        delete rest;
     74        return NULL;
     75      }
     76
     77      // now assign a new auxiliary variable (with the same index,
     78      // "wind", as the old original variable) to the expression
     79      // contained in "rest"
    5580
    5681      p -> Commuted () [wind] = true;
Note: See TracChangeset for help on using the changeset viewer.