Ignore:
Timestamp:
Nov 11, 2013 12:27:32 PM (6 years ago)
Author:
forrest
Message:

Minor stability fixes and an option to allow perturbation after presolve

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/1.15/Clp/src/AbcSimplexDual.cpp

    r1910 r1989  
    15951595  // not free
    15961596  int lastSequence = -1;
     1597  double lastTheta = 0.0;
    15971598  double lastPivotValue = 0.0;
    15981599  double thisPivotValue=0.0;
     
    16601661           numberRemaining);
    16611662#endif
    1662     if (totalThru + thruThis >= fabs(dualOut_) ||
     1663    if (totalThru + thruThis > fabs(dualOut_)-fabs(1.0e-9*dualOut_)-1.0e-12 ||
    16631664        (increaseInObjective + increaseInThis < 0.0&&bestSequence>=0) || !numberRemaining) {
    16641665      // We should be pivoting in this batch
     
    17991800        if (theta < 0.0)
    18001801          thruThis += fabs(dualOut_); // force using this one
    1801         if (increaseInObjective < 0.0 && increase < 0.0 && lastSequence >= 0) {
     1802        if (((increaseInObjective < 0.0 && increase < 0.0)||
     1803             (theta>1.0e9 && lastTheta < 1.0e-5))
     1804            && lastSequence >= 0) {
    18021805          // back
    18031806          // We may need to be more careful - we could do by
     
    18091812          totalThru += thruThis;
    18101813          increaseInObjective += increaseInThis;
     1814          lastTheta=theta;
    18111815        }
    18121816        if (bestPivot < 0.1 * bestEverPivot &&
     
    22832287  // save arrays
    22842288  CoinMemcpyN(internalStatus_, numberTotal_, internalStatusSaved_);
     2289  // save costs
     2290  CoinMemcpyN(abcCost_,numberTotal_,abcCost_+2*numberTotal_);
    22852291  CoinMemcpyN(abcSolution_,numberTotal_,solutionSaved_);
    22862292}
     
    22972303    // trouble - restore solution
    22982304    CoinMemcpyN(internalStatusSaved_, numberTotal_, internalStatus_);
     2305    CoinMemcpyN(abcCost_+2*numberTotal_,numberTotal_,abcCost_);
    22992306    CoinMemcpyN(solutionSaved_,numberTotal_, abcSolution_);
    23002307    int *  COIN_RESTRICT abcPivotVariable = abcPivotVariable_;
     
    29382945          abort();
    29392946        }
     2947        moveToBasic();
    29402948#if PARTITION_ROW_COPY==1
    29412949        int iVector=getAvailableArray();
     
    29452953        // get primal and dual solutions
    29462954        numberBlackMarks+=gutsOfSolution(3);
     2955        //gutsOfSolution(1);
     2956        makeNonFreeVariablesDualFeasible();
    29472957      }
    29482958    }
Note: See TracChangeset for help on using the changeset viewer.