Changeset 732


Ignore:
Timestamp:
Jul 3, 2011 4:06:50 PM (9 years ago)
Author:
pbelotti
Message:

fixed semiaux exprDiv convexification on fixed denominator. Renovated redcost BT, optimality based BT, and probing. New elimination of negative eigenvalue from FP HessLag?

Location:
trunk/Couenne/src
Files:
9 edited

Legend:

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

    r694 r732  
    3535#define THRES_ABT_ORIG       100  // only do ABT on auxiliaries if they are less originals than this
    3636
    37 static double distanceToBound (int n, const double* xOrig,
    38                                const double* lower, const double* upper) {
    39 
    40   double Xdist = 0.;
    41 
    42   for (int i=0, j=n; j--; i++) {
    43 
    44     CouNumber
    45       diff,
    46       xO = xOrig [i];
    47 
    48     if      ((diff = lower [i] - xO) > 0) Xdist += diff;
    49     else if ((diff = xO - upper [i]) > 0) Xdist += diff;
     37static double distanceToBound (register int n,
     38                               register const double* xOrig,
     39                               register const double* lower,
     40                               register const double* upper,
     41                               register double cutoff_distance) { // stop if distance is above this
     42
     43  register double Xdist = 0.;
     44
     45  for (int i=0; n--; ++i, ++upper) {
     46
     47    register CouNumber diff = *lower++ - *xOrig++;
     48
     49    if      ( diff                    > 0) {if ((Xdist += diff) > cutoff_distance) break;}
     50    else if ((diff = *xOrig - *upper) > 0) {if ((Xdist += diff) > cutoff_distance) break;}
    5051  }
    5152
     
    6465                                   Bonmin::BabInfo * babInfo) const {
    6566
    66   Jnlst () -> Printf (J_ITERSUMMARY, J_BOUNDTIGHTENING, "Probing\n");
    67 
    6867  if (info.level <= 0 && !(info.inTree))  {
    6968    jnlst_ -> Printf (J_ERROR, J_COUENNE, "Probing: ");
     
    7877
    7978  CouNumber
    80     *olb = new CouNumber [ncols],
    81     *oub = new CouNumber [ncols];
    82 
    83   // save current bounds
    84   CoinCopyN (Lb (), ncols, olb);
    85   CoinCopyN (Ub (), ncols, oub);
     79    *olb = CoinCopyOfArray (Lb (), ncols),
     80    *oub = CoinCopyOfArray (Ub (), ncols);
    8681
    8782  // Find the solution that is closest to the current bounds
     
    9792    for (std::list<SmartPtr<const CouenneInfo::NlpSolution> >::const_iterator
    9893           i = solList.begin();
    99          i != solList.end(); i++) {
    100       assert(nOrigVars_ == (*i)->nVars());
    101       const double thisDist = distanceToBound(nOrigVars_, (*i)->solution(), olb, oub);
     94         i != solList.end(); ++i) {
     95
     96      assert (nOrigVars_ == (*i)->nVars());
     97
     98      const double thisDist = distanceToBound (nOrigVars_, (*i)->solution(), olb, oub, dist);
     99
    102100      if (thisDist < dist) {
    103101        closestSol = *i;
     
    150148        nlp -> initialSolve ();
    151149      }
     150
    152151      catch (Bonmin::TNLPSolver::UnsolvedError *E) {}
    153152   
     
    236235        int index = evalOrder (i);
    237236
    238         if (Var (index) -> Multiplicity () <= 0)
     237        if ((Var (index) -> Multiplicity () <= 0) ||
     238            (fabs (Lb (index) - Ub (index)) < COUENNE_EPS))
    239239          continue;
    240240
  • trunk/Couenne/src/bound_tightening/boundTightening.cpp

    r694 r732  
    228228
    229229  CouNumber
    230     UB = getCutOff (), //babInfo -> babPtr () -> model (). getObjValue(), // todo: get cutoff
    231     LB = Lb (objind);  //babInfo -> babPtr () -> model (). getBestPossibleObjValue (); // todo:  w_0^l
     230    UB = getCutOff (), //babInfo -> babPtr () -> model (). getObjValue(),
     231    LB = Lb (objind);  //babInfo -> babPtr () -> model (). getBestPossibleObjValue ();
    232232
    233233  //////////////////////// Reduced cost bound tightening //////////////////////
     
    244244    if (jnlst_ -> ProduceOutput (Ipopt::J_MATRIX, J_BOUNDTIGHTENING)) {
    245245      printf ("REDUCED COST BT (LB=%g, UB=%g):\n", LB, UB);
    246       for (int i=0; i < nVars (); i++)
    247         printf ("%3d %10e [%10e %10e] rc %10e\n", i, X [i], L [i], U [i], RC [i]);
     246      for (int i=0, j=0; i < nVars (); i++) {
     247        if (Var (i) -> Multiplicity () <= 0)
     248          continue;
     249        printf ("%3d %7e [%7e %7e] c %7e ", i, X [i], L [i], U [i], RC [i]);
     250        if (!(++j % 3))
     251          printf ("\n");
     252      }
    248253      printf ("-----------\n");
    249254    }
     
    261266          rc = RC [i];
    262267
    263         if ((rc < COUENNE_EPS) || (l==u)) // no need to check
     268#define CLOSE_TO_BOUNDS 1.e-15
     269
     270        if ((fabs (rc)  < CLOSE_TO_BOUNDS) ||
     271            (fabs (l-u) < CLOSE_TO_BOUNDS)) // no need to check
    264272          continue;
    265273
    266274        bool isInt = Var (i) -> isInteger ();
    267275
    268         if (x == l) {
     276        if ((rc >= 0.) &&
     277            (fabs (x-l) <= CLOSE_TO_BOUNDS)) {
     278
    269279          if (LB + (u-l)*rc > UB) {
    270             //printf ("ub [%d]: %g ", i, Ub (i));
    271             Ub (i) = l + (UB-LB) / rc;
    272             if (isInt)
    273               Ub (i) = floor (Ub (i) + COUENNE_EPS);
    274             //printf ("--> %g\n", Ub (i));
    275             nchanges++;
    276             chg_bds [i].setLower(t_chg_bounds::CHANGED);
     280
     281            CouNumber newUb = l + (UB-LB) / rc; // which is surely < u
     282            newUb = !isInt ? newUb : floor (newUb + COUENNE_EPS);
     283
     284            if (newUb < Ub (i)) {
     285
     286              Ub (i) = newUb;
     287
     288              nchanges++;
     289              chg_bds [i].setLower (t_chg_bounds::CHANGED);
     290            }
    277291          }
    278         } else if (x == u) {
    279           if (LB + (u-l) * rc > UB) {
    280             //printf ("lb [%d]: %g ", i, Lb (i));
    281             Lb (i) = u - (UB-LB) / rc;
    282             if (isInt)
    283               Lb (i) = ceil (Lb (i) - COUENNE_EPS);
    284             //printf ("--> %g\n", Lb (i));
    285             nchanges++;
    286             chg_bds [i].setUpper(t_chg_bounds::CHANGED);
     292
     293        } else if ((rc <= 0.) &&
     294                   (fabs (x-u) <= CLOSE_TO_BOUNDS)) {
     295
     296          if (LB - (u-l) * rc > UB) {
     297
     298            CouNumber newLb = u + (UB-LB) / rc; // recall rc < 0 here
     299
     300            newLb = !isInt ? newLb : ceil (newLb - COUENNE_EPS);
     301
     302            if (newLb > Lb (i)) {
     303
     304              Lb (i) = newLb;
     305
     306              nchanges++;
     307              chg_bds [i].setUpper (t_chg_bounds::CHANGED);
     308            }
    287309          }
    288310        }
    289311      }
    290312
    291     /*printf ("AFTER reduced cost bt:\n");
    292       for (int i=0; i < nVars (); i++)
    293         printf ("%3d [%10e %10e]\n", i, Lb (i), Ub (i));
    294         printf ("-----------\n");*/
     313    if (jnlst_ -> ProduceOutput (Ipopt::J_MATRIX, J_BOUNDTIGHTENING)) {
     314      printf ("AFTER reduced cost bt:\n");
     315      for (int i=0, j=0; i < nVars (); ++i) {
     316        if (Var (i) -> Multiplicity () <= 0)
     317          continue;
     318        printf ("%3d [%7e %7e] ", i, Lb (i), Ub (i));
     319        if (!(++j % 4))
     320          printf ("\n");
     321      }
     322      printf ("-----------\n");
     323    }
    295324  }
    296325
  • trunk/Couenne/src/bound_tightening/fake_tightening.cpp

    r603 r732  
    1414#include "CouenneProblemElem.hpp"
    1515#include "CouenneExprVar.hpp"
     16
    1617#include "BonBabInfos.hpp"
    17 
    18 //#define DEBUG
    1918
    2019using namespace Couenne;
     
    7271
    7372    } else // [l,u]
    74       return (direction ? (x + (ub-x) / AGGR_DIV) : x - (x-lb) / AGGR_DIV);
     73      return (direction ?
     74              (x + (ub-x) / AGGR_DIV) :
     75              (x - (x-lb) / AGGR_DIV));
    7576  }
    7677}
     
    110111  // (with relative expense) but not the derivative.
    111112
    112 #ifdef DEBUG
    113   CouNumber curdb     = Lb (objind);// : Ub (objind);  // current dual bound
    114   printf ("  x_%d.  x = %10g, lb = %g, cutoff = %g-----------------\n", index,xcur,curdb,getCutOff());
    115 #endif
     113  jnlst_ -> Printf (Ipopt::J_ERROR, J_BOUNDTIGHTENING,
     114                    "  x_%d.  x = %10g, lb = %g, cutoff = %g-----------------\n",
     115                    index,xcur,Lb (objind),getCutOff());
    116116
    117117  /*if (index == objind)
     
    123123    if (intvar) {
    124124
    125       if (!direction) {inner = floor (inner); outer = ceil  (outer);}
    126       else            {inner = ceil  (inner); outer = floor (outer);}
     125      if (!direction) {inner = floor (inner + COUENNE_EPS); outer = ceil  (outer - COUENNE_EPS);}
     126      else            {inner = ceil  (inner - COUENNE_EPS); outer = floor (outer + COUENNE_EPS);}
    127127
    128128      if ( (direction && (inner > outer)) ||
    129129          (!direction && (inner < outer))) {
     130
     131        // fictitious interval is empty
    130132
    131133        // apply bound
     
    134136
    135137        tightened = true;
     138
     139        if (!(btCore (f_chg)))
     140          return -1;
    136141
    137142        // restore initial bound
     
    149154
    150155    if (direction) {
    151       Lb (index) = intvar ? ceil (fb) : fb;
     156      Lb (index) = intvar ? ceil (fb - COUENNE_EPS) : fb;
    152157      f_chg [index].setLower (t_chg_bounds::CHANGED);
    153158    } else {
    154       Ub (index) = intvar ? floor (fb) : fb;
     159      Ub (index) = intvar ? floor (fb + COUENNE_EPS) : fb;
    155160      f_chg [index].setUpper (t_chg_bounds::CHANGED);
    156161    }
     
    158163    //    (direction ? lb_ : ub_) [index] = fb;
    159164
    160 #ifdef DEBUG
    161     char c1 = direction ? '-' : '>', c2 = direction ? '<' : '-';
    162     printf ("    #%3d: [%+10g -%c %+10g %c- %+10g] /\\/\\ ",iter,olb[index],c1,fb,c2, oub [index]);
    163     printf (" [%10g,%10g]<%g,%g>=> ",Lb (index),Ub (index),CoinMin(inner,outer),CoinMax(inner,outer));
    164 #endif
     165    if (jnlst_ -> ProduceOutput (Ipopt::J_ERROR, J_BOUNDTIGHTENING)) {
     166      char c1 = direction ? '-' : '>', c2 = direction ? '<' : '-';
     167      printf ("    #%3d: [%+10g -%c %+10g %c- %+10g] /\\/\\ ",iter,olb[index],c1,fb,c2, oub [index]);
     168      printf (" [%10g,%10g]<%g,%g>=> ",Lb (index),Ub (index),CoinMin(inner,outer),CoinMax(inner,outer));
     169    }
    165170
    166171    bool
    167       feasible  = btCore (f_chg),             // true if feasible with fake bound
    168       betterbds = Lb (objind) > getCutOff (); // true if over cutoff
    169 
    170 #ifdef DEBUG
    171     printf(" [%10g,%10g] lb = %g {fea=%d,btr=%d} ",
    172            Lb (index), Ub (index), Lb (objind),feasible,betterbds);
    173 #endif
     172      feasible  = btCore (f_chg),                           // true if feasible with fake bound
     173      betterbds = Lb (objind) > getCutOff () + COUENNE_EPS; // true if over cutoff
     174
     175    jnlst_ -> Printf (Ipopt::J_ERROR, J_BOUNDTIGHTENING,
     176                      " [%10g,%10g] lb = %g {fea=%d,btr=%d} ",
     177                      Lb (index), Ub (index), Lb (objind),feasible,betterbds);
    174178
    175179    if (feasible && !betterbds) {
     
    184188
    185189    } else {
     190
     191      // Here, !feasible || betterbds
     192      //
     193      // If !feasible OR
     194      //    (betterbds and the new lb is above the cutoff)
     195      //
     196      // then there is a tightening
    186197
    187198      // case 2: tightening valid, apply and move outer in
     
    228239      if (direction) {
    229240
    230         oub [index] = Ub (index) = intvar ? floor (fb) : fb;
     241        oub [index] = Ub (index) = intvar ? floor (fb + COUENNE_EPS) : fb;
    231242        chg_bds [index]. setUpper (t_chg_bounds::CHANGED);
    232       }
    233       else {
    234         olb [index] = Lb (index) = intvar ? ceil (fb) : fb;
    235         chg_bds [index].setLower (t_chg_bounds::CHANGED);
     243
     244      } else {
     245
     246        olb [index] = Lb (index) = intvar ? ceil (fb - COUENNE_EPS) : fb;
     247        chg_bds [index]. setLower (t_chg_bounds::CHANGED);
    236248      }
    237249
     
    249261      // check tightened problem for feasibility
    250262      if (!(btCore (chg_bds))) {
    251 #ifdef DEBUG
    252         printf ("\n    pruned by aggressive BT\n");
    253 #endif
     263
     264        jnlst_ -> Printf (Ipopt::J_ERROR, J_BOUNDTIGHTENING,
     265                          "\n    pruned by aggressive BT\n");
    254266        return -1;
     267
     268      } else {
     269
     270        // bounds further tightened should be saved
     271       
     272        CoinCopyN (Lb (), ncols, olb);
     273        CoinCopyN (Ub (), ncols, oub);
    255274      }
    256275      //#endif
     
    262281    //fb = fictBounds (direction, fb, CoinMin (inner, outer), CoinMax (inner, outer));
    263282
    264     CouNumber diff = fabs (inner-outer);
    265 
    266     if (diff == 0.) break;
    267 
    268     if (diff > 1) {
     283    // inner and outer might have to change. Update
     284
     285    CouNumber
     286      lb = Lb (index),
     287      ub = Ub (index);
     288
     289    if ((!direction && ((inner > ub) || (outer < lb))) ||
     290        ( direction && ((inner < lb) || (outer > ub)))) {
     291
     292      // keep it simple
     293
     294      inner = direction ? lb : ub;
     295      outer = direction ? ub : lb;
     296    }
     297
     298    CouNumber diff = fabs (inner - outer);
     299
     300    if (diff <= COUENNE_EPS) break;
     301
     302    if (diff > 1.) {
    269303
    270304      CouNumber L = log (diff) / log (10.);
     
    273307      else           fb = inner - exp (log (10.) * L/2);
    274308
    275     } else fb = (inner+outer)/2;
     309    } else fb = (inner + outer)/2;
    276310
    277311    //    if () fb = (          inner + (phi-1) * outer) / phi;
     
    283317    //       direction ? outer      : ub [index]);
    284318
    285 #ifdef DEBUG
    286     printf ("\n");
    287 #endif
     319    jnlst_ -> Printf (Ipopt::J_ERROR, J_BOUNDTIGHTENING, "\n");
    288320  }
    289321
  • trunk/Couenne/src/bound_tightening/obbt_iter.cpp

    r694 r732  
    3333  csi -> setDblParam (OsiDualObjectiveLimit, COIN_DBL_MAX);
    3434  csi -> setDblParam (OsiPrimalObjectiveLimit, (sense==1) ? bound : -bound);
    35   csi -> setObjSense (1); // always minimize, just change the sign of the variable
     35  //csi -> setObjSense (1); // always minimize, just change the sign of the variable // done in caller
    3636
    3737  ////////////////////////////////////////////////////////////////////////
     
    148148        var -> Image () -> getBounds (lb, ub);
    149149
     150        if (lb < Lb (index)) lb = Lb (index);
     151        if (ub > Ub (index)) ub = Ub (index);
     152
    150153        if (var -> isInteger ()) {
    151154          lb = ceil  (lb - COUENNE_EPS);
     
    153156        }
    154157
    155         if (csi -> getColLower () [index] < lb - COUENNE_EPS) {
     158        if (lb > csi -> getColLower () [index] + COUENNE_EPS) {
    156159          csi -> setColLower (index, lb);
    157160          Lb (index) = lb;
     
    159162        } else chg_bds [index].setLowerBits(t_chg_bounds::EXACT);
    160163
    161         if (csi -> getColUpper () [index] > ub + COUENNE_EPS) {
     164        if (ub < csi -> getColUpper () [index] - COUENNE_EPS) {
    162165          csi -> setColUpper (index, ub);
    163166          Ub (index) = ub;
     
    257260        }
    258261      }
     262
     263      if (sense == 1) {if (bound > Lb (index)) Lb (index) = bound;}
     264      else            {if (bound < Ub (index)) Ub (index) = bound;}
    259265
    260266      // more conservative, only change (and set CHANGED) if improve
  • trunk/Couenne/src/bound_tightening/twoImpliedBT/TwoImpliedGenCuts.cpp

    r698 r732  
    403403  double
    404404    *clb = CoinCopyOfArray (problem_ -> Lb (), n),
    405     *cub = CoinCopyOfArray (problem_ -> Ub (), n);
     405    *cub = CoinCopyOfArray (problem_ -> Ub (), n),
     406    *oldLB = CoinCopyOfArray (problem_ -> Lb (), n),
     407    *oldUB = CoinCopyOfArray (problem_ -> Ub (), n);
    406408
    407409  const int
     
    678680  if (result >= 0 && ntightened) {
    679681
    680     const double
    681       *oldLB = si.getColLower (),
    682       *oldUB = si.getColUpper ();
    683 
    684682    // check old and new bounds
    685683
     
    700698        if (problem_ -> bestSol () &&
    701699            problem_ -> bestSol () [i] > oldLB [i] &&
    702             problem_ -> bestSol () [i] < clb   [i]) {
     700            problem_ -> bestSol () [i] < clb   [i] - 1e-12) {
    703701
    704702          jnlst_ -> Printf (J_ERROR, J_COUENNE,
    705                             "Warning, twoImplBounds new LB cuts optimal solution: LB x_%d = %g --> %g, opt %g\n",
    706                             i, oldLB [i], clb [i], problem_ -> bestSol () [i]);
     703                            "Warning, twoImplBounds new LB cuts optimal solution: LB x_%d = %g --> %g, opt %g (diff: %g)\n",
     704                            i, oldLB [i], clb [i], problem_ -> bestSol () [i], clb [i] - problem_ -> bestSol () [i]);
    707705
    708706        }
     
    717715        if (problem_ -> bestSol () &&
    718716            problem_ -> bestSol () [i] < oldUB [i] &&
    719             problem_ -> bestSol () [i] > cub   [i]) {
     717            problem_ -> bestSol () [i] > cub   [i] + 1e-12) {
    720718
    721719          jnlst_ -> Printf (J_ERROR, J_COUENNE,
    722                             "Warning, twoImplBounds new UB cuts optimal solution: UB x_%d = %g --> %g, opt %g\n",
    723                             i, oldUB [i], cub [i], problem_ -> bestSol () [i]);
     720                            "Warning, twoImplBounds new UB cuts optimal solution: UB x_%d = %g --> %g, opt %g (diff: %g)\n",
     721                            i, oldUB [i], cub [i], problem_ -> bestSol () [i], problem_ -> bestSol () [i] - cub [i]);
    724722
    725723        }
     
    758756  delete [] clb;
    759757  delete [] cub;
     758  delete [] oldLB;
     759  delete [] oldUB;
    760760  delete [] sa1;
    761761  delete [] sa2;
  • trunk/Couenne/src/convex/operators/conv-exprDiv.cpp

    r490 r732  
    55 * Purpose: standardization and convexification methods for divisions
    66 *
    7  * (C) Carnegie-Mellon University, 2006-10.
     7 * (C) Carnegie-Mellon University, 2006-11.
    88 * This file is licensed under the Eclipse Public License (EPL)
    99 */
     
    5353  }
    5454
    55   if ((yl < -0.) && (yu > 0.)) return;   // no convexification for
    56                                          // terms x/y where y=0 is
    57                                          // internal to the bounding
    58                                          // box
     55  // no convexification for terms x/y where y=0 is internal to the
     56  // bounding box
     57
     58  if ((yl < -0.) &&
     59      (yu >  0.)) return;   
     60
    5961  CouNumber k;
    6062
     
    6668      ((fabs (k = ((yl+yu) / 2)) > COUENNE_EPS))) {
    6769    if (cLY || cRY)
    68       cg -> createCut (cs, 0., sign, wi, -1., xi, 1./k);
     70      cg -> createCut (cs, 0., sign, wi, 1., xi, -1./k);
    6971    return;
    7072  }
     
    9698  arglist_ [0] -> getBounds (xl, xu);
    9799
     100  if ((fabs (xl-xu) < COUENNE_EPS) &&
     101      (fabs (yl-yu) < COUENNE_EPS) &&
     102      (fabs (wl-wu) < COUENNE_EPS))
     103    return; // not much to do here...
     104
    98105  // same as product, just a change in coordinates
    99106
     
    101108  CouNumber *x = cg -> Problem () -> X ();
    102109
     110  bool
     111    ineqFullOrthantF = (((sign == expression::AUX_LEQ) && (yl >  0.)) || ((sign == expression::AUX_GEQ) && (yu < -0.))),
     112    ineqFullOrthantB = (((sign == expression::AUX_LEQ) && (yu < -0.)) || ((sign == expression::AUX_GEQ) && (yl >  0.)));
     113
    103114  unifiedProdCuts (cg, cs,
    104115                   wi, x [wi], wl, wu,
    105116                   yi, x [yi], yl, yu,
    106117                   xi, x [xi],
    107                    (((sign == expression::AUX_LEQ) && (yl >  0.)) || ((sign == expression::AUX_GEQ) && (yu < -0.)))? -COIN_DBL_MAX : xl,
    108                    (((sign == expression::AUX_LEQ) && (yu < -0.)) || ((sign == expression::AUX_GEQ) && (yl >  0.)))?  COIN_DBL_MAX : xu,
     118                   ineqFullOrthantF ? -COIN_DBL_MAX : xl,
     119                   ineqFullOrthantB ?  COIN_DBL_MAX : xu,
    109120                   chg,
    110                    (((sign == expression::AUX_LEQ) && (yl >  0.)) || ((sign == expression::AUX_GEQ) && (yu < -0.)))? expression::AUX_GEQ :
    111                    (((sign == expression::AUX_LEQ) && (yu < -0.)) || ((sign == expression::AUX_GEQ) && (yl >  0.)))? expression::AUX_LEQ :
    112                    expression::AUX_EQ);
     121                   ineqFullOrthantF ? expression::AUX_GEQ :
     122                   ineqFullOrthantB ? expression::AUX_LEQ :
     123                                      expression::AUX_EQ);
    113124}
  • trunk/Couenne/src/heuristics/CouenneFPcreateMILP.cpp

    r724 r732  
    1919#include "CouenneProblemElem.hpp"
    2020
     21#define COUENNE_EIG_RATIO .1 // how much smaller than the largest eigenvalue should the minimum be set at?
     22
    2123using namespace Couenne;
    2224
     
    233235
    234236  // call Lapack/Blas routines
    235 
    236237  double *eigenval = (double *) malloc (n   * sizeof (double));
    237 
    238238  int status;
    239239
     240  // compute eigenvalues and eigenvectors
    240241  Ipopt::IpLapackDsyev (true, n, A, n, eigenval, status);
    241242
     
    259260  //
    260261
     262  // if all eigenvalues are nonpositive, set them all to one
     263
     264  double
     265    MinEigVal = eigenval [0],
     266    MaxEigVal = eigenval [n-1];
     267
     268  for (int j=1; j<n; j++)
     269    assert (eigenval [j-1] <= eigenval [j]);
     270
     271  if (MaxEigVal <= 0.)
     272
     273    // in this case it makes sense to invert each eigenvalue
     274    // (i.e. take its inverse) and change its sign, as the steepest
     275    // descent should correspond to the thinnest direction
     276
     277    for (int j=0; j<n; j++)
     278      eigenval [j] = 1. / (.1 - eigenval [j]);
     279
     280  else {
     281
     282    // set all not-too-positive ones to a fraction of the maximum
     283    // ("un-thins" the level curves defined by the HL)
     284
     285    MinEigVal = MaxEigVal * COUENNE_EIG_RATIO;
     286
     287    if (eigenval [0] <= MinEigVal)
     288      for (int j=0; eigenval [j] <= MinEigVal; j++)
     289        eigenval [j] = MinEigVal;
     290  }
     291
     292  // Now obtain sqrt (A)
     293
    261294  for (int j=0; j<n; ++j) {
    262 
    263     if (eigenval [j] < 0.)
    264       eigenval [j] = 0.;
    265295
    266296    register double sqrtEig = sqrt (eigenval [j]);
  • trunk/Couenne/src/main/BonCouenne.cpp

    r698 r732  
    181181                                CoinMax (1., timeLimit - time_start));
    182182
    183     jnlst -> Printf (J_ERROR, J_COUENNE, "Starting branch-and-bound\n");
     183    //jnlst -> Printf (J_ERROR, J_COUENNE, "Starting branch-and-bound\n");
    184184
    185185    //////////////////////////////////
  • trunk/Couenne/src/standardize/analyzeSparsity.cpp

    r490 r732  
    6262            qmap.Map().size (),
    6363            occur.size (),
    64             MIN_DENSITY * occur.size () * (occur.size () + 1) / 2);
     64            MIN_DENSITY * (double) (occur.size ()) * ((double) (occur.size ()) + 1.) / 2);
    6565  }
    6666
Note: See TracChangeset for help on using the changeset viewer.