Changeset 2171 for trunk


Ignore:
Timestamp:
Sep 22, 2015 4:18:43 AM (4 years ago)
Author:
forrest
Message:

change in fastdual

File:
1 edited

Legend:

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

    r2159 r2171  
    402402     double largestPrimalError = 0.0;
    403403     double largestDualError = 0.0;
     404     double smallestPrimalInfeasibility=COIN_DBL_MAX;
    404405     int numberRayTries=0;
    405406     // Start can skip some things in transposeTimes
     
    488489          statusOfProblemInDual(lastCleaned, factorType, saveDuals, data,
    489490                                ifValuesPass);
     491          smallestPrimalInfeasibility=CoinMin(smallestPrimalInfeasibility,
     492                                              sumPrimalInfeasibilities_);
     493          if (sumPrimalInfeasibilities_>1.0e5 &&
     494              sumPrimalInfeasibilities_>1.0e5*smallestPrimalInfeasibility &&
     495              (moreSpecialOptions_&256)==0 &&
     496              progress_.lastObjective(0)<-1.0e10 &&
     497              progress_.lastObjective(1)>-1.0e5) {
     498            // problems - try dual
     499            problemStatus_=10;
     500            // mark as large infeasibility cost wanted
     501            sumPrimalInfeasibilities_ = -123456789.0;
     502            //for (int i=0;i<numberRows_+numberColumns_;i++) {
     503            //if (fabs(cost_[i]*solution_[i])>1.0e4)
     504            //  printf("col %d cost %g sol %g bounds %g %g\n",
     505            //         i,cost_[i],solution_[i],lower_[i],upper_[i]);
     506            //}
     507          }
    490508          if ((specialOptions_&2097152)!=0&&problemStatus_==1&&!ray_&&
    491509              !numberRayTries && numberIterations_) {
     
    33923410  info.bestPossible = bestPossible;
    33933411}
     3412static
     3413void ClpMemmove(void * to, void * from,int nChar)
     3414{ memmove(to,from,nChar);}
    33943415// later do so less zeroing in first blocks
    33953416// and some of it combined for loop to move and zero
     
    35253546          upperTheta = CoinMin(upperTheta,info[0].upperTheta);
    35263547          for (int i=1;i<ABOCA_LITE;i++) {
    3527             memmove(index+numberRemaining,info[i].index,info[i].numberRemaining*sizeof(int));
     3548            ClpMemmove(index+numberRemaining,info[i].index,info[i].numberRemaining*sizeof(int));
    35283549            moveAndZero(spare+numberRemaining,info[i].spare,info[i].numberRemaining);
    35293550            numberRemaining += info[i].numberRemaining;
     
    40574078                         // If we have done pivots and things look bad set alpha_ 0.0 to force factorization
    40584079                         if (sumBadPivots > 1.0e4) {
    4059                               if (handler_->logLevel() > 3)
     4080                              if (handler_->logLevel() > 1)
    40604081                                   *handler_ << "maybe forcing re-factorization - sum " << sumBadPivots << " " << factorization_->pivots() << " pivots" << CoinMessageEol;
    40614082                              if(factorization_->pivots() > 3) {
     
    42554276     if ((badSumPivots ||
    42564277               fabs(theta_ * badFree) > 10.0 * dualTolerance_) && factorization_->pivots()) {
    4257           if (handler_->logLevel() > 3)
     4278          if (handler_->logLevel() > 1)
    42584279               *handler_ << "forcing re-factorization" << CoinMessageEol;
    42594280          //printf("badSumPivots %g theta_ %g badFree %g\n",badSumPivots,theta_,badFree);
     
    68446865     }
    68456866     // slows down slightly - but more accurate
    6846      if (factorization_->pivots())
     6867     if (factorization_->pivots()) {
     6868       columnArray_[0]->clear();
    68476869       computeDuals(NULL);
    6848 
     6870     }
     6871       
    68496872     // clear
    68506873     for (iRow = 0; iRow < 4; iRow++) {
Note: See TracChangeset for help on using the changeset viewer.