Changeset 1790 for trunk


Ignore:
Timestamp:
Sep 8, 2011 12:46:09 PM (8 years ago)
Author:
forrest
Message:

improve robustness of parametrics

Location:
trunk/Clp/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpEventHandler.hpp

    r1769 r1790  
    6464          updateDualsInDual,
    6565          endOfCreateRim,
     66          slightlyInfeasible,
    6667          noTheta // At end (because no pivot)
    6768     };
  • trunk/Clp/src/ClpSimplexOther.cpp

    r1785 r1790  
    32433243            lower_[iSequence]=value;
    32443244          } else if (value>upper_[iSequence]+1.0e-9) {
    3245             moved = upper_[iSequence]-value;
     3245            moved += upper_[iSequence]-value;
    32463246            upper_[iSequence]=value;
    32473247          }
    32483248        }
     3249        if (!moved) {
     3250          for (int iSequence=0;iSequence<numberColumns_;iSequence++) {
     3251            double value=solution_[iSequence];
     3252            if (value<lower_[iSequence]-1.0e-9) {
     3253              moved += lower_[iSequence]-value;
     3254              lower_[iSequence]=value;
     3255            } else if (value>upper_[iSequence]+1.0e-9) {
     3256              moved += upper_[iSequence]-value;
     3257              upper_[iSequence]=value;
     3258            }
     3259          }
     3260        }
     3261        assert (moved);
    32493262        reinterpret_cast<ClpSimplexDual *> (this)->gutsOfDual(1, saveDuals, -1, data);
    32503263      }
     
    33853398          handler_->message() << CoinMessageEol;
    33863399     }
     3400#ifdef CLP_USER_DRIVEN
     3401     if (sumPrimalInfeasibilities_&&sumPrimalInfeasibilities_<1.0e-7) {
     3402       int status=eventHandler_->event(ClpEventHandler::slightlyInfeasible);
     3403       if (status>=0) {
     3404         // fix up
     3405         for (int iSequence=0;iSequence<numberRows_+numberColumns_;iSequence++) {
     3406           double value=solution_[iSequence];
     3407           if (value<=lower_[iSequence]-primalTolerance_) {
     3408             lower_[iSequence]=value;
     3409           } else if (value>=upper_[iSequence]+primalTolerance_) {
     3410             upper_[iSequence]=value;
     3411           }
     3412         }
     3413         numberPrimalInfeasibilities_ = 0;
     3414         sumPrimalInfeasibilities_ = 0.0;
     3415       }
     3416     }
     3417#endif
    33873418     /* If we are primal feasible and any dual infeasibilities are on
    33883419        free variables then it is better to go to primal */
Note: See TracChangeset for help on using the changeset viewer.