Changeset 1426 for trunk/Clp


Ignore:
Timestamp:
Aug 29, 2009 11:39:30 AM (10 years ago)
Author:
forrest
Message:

minor changes for an idea

Location:
trunk/Clp/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/CbcOrClpParam.cpp

    r1424 r1426  
    23242324    (
    23252325     "Yet more ideas for Feasibility Pump \n\
     2326\t/1000 == 1 Pump will run twice if no solution found\n\
     2327\t/1000 == 2 Pump will only run after root cuts if no solution found\n\
     2328\t/1000 >10 as above but even if solution found\n\
    23262329\t/100 == 1,3.. exact 1.0 for objective values\n\
    23272330\t/100 == 2,3.. allow more iterations per pass\n\
  • trunk/Clp/src/ClpSimplex.cpp

    r1424 r1426  
    638638      return numberOut;
    639639  }
    640 
     640  if ((moreSpecialOptions_&128)!=0&&!numberIterations_) {
     641    //printf("trying feas pump\n");
     642    const char * integerType = integerInformation();
     643    assert (integerType);
     644    assert (perturbationArray_);
     645    CoinZeroN(cost_,numberRows_+numberColumns_);
     646    for (int i=0;i<numberRows_-numberRows_;i++) {
     647      int iSequence = pivotVariable_[i];
     648      if (iSequence<numberColumns_&&integerType[iSequence]) {
     649        double lower =lower_[iSequence];
     650        double upper = upper_[iSequence];
     651        double value = solution_[iSequence];
     652        if (value>=lower-primalTolerance_&&
     653            value<=upper+primalTolerance_) {
     654          double sign;
     655          if (value-lower<upper-value)
     656            sign=1.0;
     657          else
     658            sign=-1.0;
     659          cost_[iSequence]=sign*perturbationArray_[iSequence];
     660        }
     661      }
     662    }
     663  }
    641664  computeDuals(givenDuals);
     665  if ((moreSpecialOptions_&128)!=0&&!numberIterations_) {
     666    const char * integerType = integerInformation();
     667    // Need to do columns and rows to stay dual feasible
     668    for (int iSequence=0;iSequence<numberColumns_;iSequence++) {
     669      if (integerType[iSequence]&&getStatus(iSequence)!=basic) {
     670        double djValue=dj_[iSequence];
     671        double change=0.0;
     672        if (getStatus(iSequence)==atLowerBound)
     673          change = CoinMax(-djValue,10.0*perturbationArray_[iSequence]);
     674        else if (getStatus(iSequence)==atUpperBound)
     675          change = CoinMin(-djValue,-10.0*perturbationArray_[iSequence]);
     676        cost_[iSequence]=change;
     677        dj_[iSequence]+=change;
     678      }
     679    }
     680  }
    642681
    643682  // now check solutions
     
    97739812#endif
    97749813  }
    9775   if (numberColumns_==100) {
     9814  if (numberColumns_==-100) {
    97769815    const char * integerType = integerInformation();
    97779816    for (int i=0;i<100;i++) {
  • trunk/Clp/src/ClpSimplex.hpp

    r1424 r1426  
    951951      32 bit - say optimal if primal feasible!
    952952      64 bit - give up easily in dual (and say infeasible)
     953      128 bit - no objective, 0-1 and in B&B
    953954  */
    954955  inline int moreSpecialOptions() const
     
    962963      32 bit - say optimal if primal feasible!
    963964      64 bit - give up easily in dual (and say infeasible)
     965      128 bit - no objective, 0-1 and in B&B
    964966  */
    965967  inline void setMoreSpecialOptions(int value)
  • trunk/Clp/src/ClpSimplexDual.cpp

    r1425 r1426  
    53435343    double * sort = new double[numberColumns_];
    53445344    // Use objective BEFORE scaling
    5345     const double * obj = objective();
     5345    const double * obj = ((moreSpecialOptions_&128)==0) ? objective() : cost_;
    53465346    int i;
    53475347    for (i=0;i<numberColumns_;i++) {
Note: See TracChangeset for help on using the changeset viewer.