Changeset 903 for stable/0.4


Ignore:
Timestamp:
Sep 3, 2012 11:58:38 PM (7 years ago)
Author:
pbelotti
Message:

merged change 902 on consistent lb/ub passed to Ipopt

Location:
stable/0.4/Couenne/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • stable/0.4/Couenne/src

  • stable/0.4/Couenne/src/bound_tightening

  • stable/0.4/Couenne/src/bound_tightening/aggressiveBT.cpp

    r806 r903  
    130130    CoinCopyN (X (), nOrigVars_ - ndefined_, Y);
    131131
    132     if (getIntegerCandidate (nlp -> getColSolution (), Y, lower, upper) < 0) {
     132    if (getIntegerCandidate (nlp -> getColSolution () ? nlp -> getColSolution () : Y, Y, lower, upper) < 0) {
    133133
    134134      jnlst_ -> Printf (J_ITERSUMMARY, J_BOUNDTIGHTENING, "TODO: find NLP point in ABT failed\n");
  • stable/0.4/Couenne/src/branch

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • stable/0.4/Couenne/src/expression/operators/exprGroup.cpp

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

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

    r752 r903  
    131131                  nlb [i], nub [i],
    132132                  p -> Lb (i), p -> Ub (i));*/
    133           if (nlb [i] < p -> Lb (i) - COUENNE_EPS) setColLower (i, p -> Lb (i));
    134           if (nub [i] > p -> Ub (i) + COUENNE_EPS) setColUpper (i, p -> Ub (i));
     133
     134          double
     135            lower = nlb [i],
     136            upper = nub [i];
     137
     138          if (lower       > upper)       CoinSwap (lower,       upper);
     139          if (p -> Lb (i) > p -> Ub (i)) CoinSwap (p -> Lb (i), p -> Ub (i));
     140
     141          if (lower < p -> Lb (i) - COUENNE_EPS) setColLower (i, p -> Lb (i));
     142          if (upper > p -> Ub (i) + COUENNE_EPS) setColUpper (i, p -> Ub (i));
    135143        } else {
    136144          // if not enabled, fix them in the NLP solver
     
    208216            for (int i = getNumCols (); i--;) {
    209217
    210               if (lbCur [i] > ubCur [i]) {
    211                 double swap = lbCur [i];
    212                 lbCur [i] = ubCur [i];
    213                 ubCur [i] = swap;
    214               }
     218              if (lbCur [i] > ubCur [i])
     219                CoinSwap (lbCur [i], ubCur [i]);
    215220
    216221              if      (Y [i] < lbCur [i]) Y [i] = lbCur [i];
     
    221226              if ((p -> Var (i) -> Multiplicity () > 0) &&
    222227                  p  -> Var (i) -> isDefinedInteger ()) {
     228
    223229                setColLower (i, lbCur [i]);
    224230                setColUpper (i, ubCur [i]);
     
    243249              if ((p -> Var (i) -> Multiplicity () > 0) &&
    244250                  p  -> Var (i) -> isDefinedInteger ()) {
     251
     252                if (lbSave [i] > ubSave [i])
     253                  CoinSwap (lbSave [i], ubSave [i]);
     254
    245255                setColLower (i, lbSave [i]);
    246256                setColUpper (i, ubSave [i]);
Note: See TracChangeset for help on using the changeset viewer.