Changeset 315


Ignore:
Timestamp:
Mar 13, 2010 3:54:39 PM (11 years ago)
Author:
pbelotti
Message:

some fixes on semi-auxiliaries (esp. on multilinear terms)

Location:
trunk/Couenne/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Couenne/src/bound_tightening/impliedBounds.cpp

    r307 r315  
    2323      if (variables_ [i] -> Multiplicity () >= 0) {
    2424        Jnlst()->Printf(Ipopt::J_MOREVECTOR, J_BOUNDTIGHTENING,
    25                         "x_%03d [%+15.8g %+15.8g] ", i,
     25                        "x_%03d [%+10g %+10g] ", i,
    2626                        domain_.lb (i),
    2727                        domain_.ub (i));
  • trunk/Couenne/src/convex/operators/conv-exprDiv.cpp

    r312 r315  
    1414#include "CouenneExprOp.hpp"
    1515#include "CouenneExprDiv.hpp"
    16 #include "CouenneExprClone.hpp"
     16//#include "CouenneExprClone.hpp"
    1717#include "CouenneExprMul.hpp"
    1818#include "CouenneProblem.hpp"
     
    9292
    9393  unifiedProdCuts (cg, cs,
    94                    wi, x [wi],
    95                    sign == expression::LEQ ? -COIN_DBL_MAX : wl,
    96                    sign == expression::GEQ ?  COIN_DBL_MAX : wu,
     94                   wi, x [wi], wl, wu,
     95                   //sign == expression::LEQ ? -COIN_DBL_MAX : wl,  // wrong - pass sign
     96                   //sign == expression::GEQ ?  COIN_DBL_MAX : wu,
    9797                   yi, x [yi], yl, yu,
    98                    xi, x [xi], xl, xu, chg);
     98                   xi, x [xi], xl, xu, chg,
     99                   (sign == expression::LEQ) ? expression::GEQ :
     100                   (sign == expression::GEQ) ? expression::LEQ : expression::EQ);
     101
    99102
    100103  // TODO: put real convexification...
  • trunk/Couenne/src/convex/operators/conv-exprMul-genCuts.cpp

    r312 r315  
    129129                   xi, x0,      xl, xu,
    130130                   yi, y0,      yl, yu,
    131                    wi, (*w) (),
    132                    sign == expression::LEQ ? -COIN_DBL_MAX : wl,
    133                    sign == expression::GEQ ?  COIN_DBL_MAX : wu,
    134                    chg);
     131                   wi, (*w) (), wl, wu,
     132                   //sign == expression::LEQ ? -COIN_DBL_MAX : wl,
     133                   //sign == expression::GEQ ?  COIN_DBL_MAX : wu,
     134                   chg, sign);
    135135}
  • trunk/Couenne/src/convex/operators/unifiedProdCuts.cpp

    r312 r315  
    7979                      int yi, CouNumber y0, CouNumber yl, CouNumber yu,
    8080                      int wi, CouNumber w0, CouNumber wl, CouNumber wu,
    81                       t_chg_bounds *chg) {
     81                      t_chg_bounds *chg, enum expression::auxSign sign) {
    8282
    8383  bool cLX,  cRX,  cLY,  cRY,  cLW,  cRW =
     
    100100  // These cuts are added if the corresponding bounds are finite
    101101
    102   if ((cLX || cLY) && is_boundbox_regular (yl, xl)) cg -> createCut (cs, yl*xl,-1,wi,-1.,xi,yl,yi,xl);
    103   if ((cRX || cRY) && is_boundbox_regular (yu, xu)) cg -> createCut (cs, yu*xu,-1,wi,-1.,xi,yu,yi,xu);
    104   if ((cRX || cLY) && is_boundbox_regular (yl, xu)) cg -> createCut (cs, yl*xu,+1,wi,-1.,xi,yl,yi,xu);
    105   if ((cLX || cRY) && is_boundbox_regular (yu, xl)) cg -> createCut (cs, yu*xl,+1,wi,-1.,xi,yu,yi,xl);
     102  if (sign != expression::LEQ) {
     103    if ((cLX || cLY) && is_boundbox_regular (yl, xl)) cg -> createCut (cs,yl*xl,-1,wi,-1.,xi,yl,yi,xl);
     104    if ((cRX || cRY) && is_boundbox_regular (yu, xu)) cg -> createCut (cs,yu*xu,-1,wi,-1.,xi,yu,yi,xu);
     105  }
     106
     107  if (sign != expression::GEQ) {
     108    if ((cRX || cLY) && is_boundbox_regular (yl, xu)) cg -> createCut (cs,yl*xu,+1,wi,-1.,xi,yl,yi,xu);
     109    if ((cLX || cRY) && is_boundbox_regular (yu, xl)) cg -> createCut (cs,yu*xl,+1,wi,-1.,xi,yu,yi,xl);
     110  }
    106111
    107112  // If w=xy and w >= l > 0 (resp. w <= u < 0) are "tight" bounds
     
    137142  //    alpha = [-yu + l/xt - l/(xt^2)(xu-xt)] / (xu*yu - l)
    138143
     144  if (sign == expression::GEQ)
     145    return; // nothing else to do here
    139146
    140147  if (cg -> Problem () -> MultilinSep () == CouenneProblem::MulSepSimple ||
  • trunk/Couenne/src/expression/operators/CouenneExprMul.hpp

    r312 r315  
    8686                                  int &way);
    8787
    88   /// compute $y^{lv}$ and $y^{uv}$ for Violation Transfer algorithm
     88  /// compute \f$y^{lv}\f$ and \f$y^{uv}\f$ for Violation Transfer algorithm
    8989  virtual void closestFeasible (expression *varind,
    9090                                expression *vardep,
     
    129129                      int, CouNumber, CouNumber, CouNumber,
    130130                      int, CouNumber, CouNumber, CouNumber,
    131                       t_chg_bounds *);
     131                      t_chg_bounds *, enum expression::auxSign);
    132132
    133133
     
    139139
    140140
    141 // compute distance from future convexifications in set \f$\{(x,y,w):
    142 // w = xy\}\f$ with x,y,w bounded. Unified with exprDiv
     141/// compute distance from future convexifications in set \f$\{(x,y,w):
     142/// w = xy\}\f$ with x,y,w bounded. Unified with exprDiv
    143143double *computeMulBrDist (const OsiBranchingInformation *info,
    144144                          int xi, int yi, int wi, int brind, double *brpt, int nPts = 1);
  • trunk/Couenne/src/main/Couenne.cpp

    r250 r315  
    208208  return EXIT_SUCCESS;
    209209}
     210
     211
     212
     213//int main (int argc, char **argv) {
     214
     215  // read options
     216
     217  // create problem
     218
     219  // create bb solver
     220
     221  // add cut generators
     222  // add heuristics
     223  // add branching rules
     224  // add bound reduction
     225
     226  // solve
     227
     228  // print result
     229
     230//  return retval;
     231//}
  • trunk/Couenne/src/problem/problem.cpp

    r312 r315  
    305305  int indobj = objectives_ [0] -> Body () -> Index ();
    306306
    307   if (indobj >= 0) {
    308 
    309     // all problem are assumed to be minimization
    310     double cutoff = pcutoff_ -> getCutOff();
    311 
    312     if (cutoff < Ub (indobj))
    313       Ub (indobj) = cutoff;
    314 
    315   } else jnlst_ -> Printf (J_SUMMARY, J_PROBLEM,
    316                            "Warning, could not install cutoff - negative objective index\n");
     307  assert (indobj >= 0);
     308
     309  // all problem are assumed to be minimization
     310  double cutoff = pcutoff_ -> getCutOff();
     311
     312  Jnlst () -> Printf (Ipopt::J_WARNING, J_PROBLEM,
     313                      "installing cutoff %.10e vs current ub %.10e\n",
     314                      cutoff, Ub (indobj));
     315
     316  if (cutoff < Ub (indobj))
     317    Ub (indobj) = cutoff;
    317318}
    318319
  • trunk/Couenne/src/standardize/constrStandardize.cpp

    r312 r315  
    9393        CouNumber constRHS = rest -> Value ();
    9494
    95         if (aSign == expression::GEQ) p -> Var (wind) -> lb () = constRHS;
    96         if (aSign == expression::LEQ) p -> Var (wind) -> ub () = constRHS;
     95        if (aSign != expression::LEQ) p -> Var (wind) -> lb () = constRHS;
     96        if (aSign != expression::GEQ) p -> Var (wind) -> ub () = constRHS;
    9797
    9898        delete rest;
Note: See TracChangeset for help on using the changeset viewer.