Changeset 66 for trunk


Ignore:
Timestamp:
Dec 2, 2002 9:55:30 AM (17 years ago)
Author:
forrest
Message:

Tiny changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpSimplexPrimal.cpp

    r63 r66  
    753753      createRim(4);
    754754      nonLinearCost_->checkInfeasibilities(true);
    755       nonLinearCost_=NULL;
    756       // scale
    757       int i;
    758       for (i=0;i<numberRows_+numberColumns_;i++)
    759         cost_[i] *= 1.0e-100;
    760       gutsOfSolution(rowActivityWork_, columnActivityWork_);
    761       nonLinearCost_=nonLinear;
    762       infeasibilityCost_=saveWeight;
    763       if ((infeasibilityCost_>=1.0e18||
    764           numberDualInfeasibilities_==0)&&perturbation_==101) {
    765         unPerturb(); // stop any further perturbation
    766         numberDualInfeasibilities_=1; // carry on
    767       }
    768       if (infeasibilityCost_>=1.0e20||
    769           numberDualInfeasibilities_==0) {
    770         // we are infeasible - use as ray
    771         delete [] ray_;
    772         ray_ = new double [numberRows_];
    773         memcpy(ray_,dual_,numberRows_*sizeof(double));
    774         // and get feasible duals
    775         infeasibilityCost_=0.0;
    776         createRim(4);
    777         nonLinearCost_->checkInfeasibilities(true);
     755      // may have fixed infeasibilities - double check
     756      if (nonLinearCost_->numberInfeasibilities()==0) {
     757        // carry on
     758        problemStatus_ = -1;
     759        infeasibilityCost_=saveWeight;
     760      } else {
     761        nonLinearCost_=NULL;
     762        // scale
     763        int i;
     764        for (i=0;i<numberRows_+numberColumns_;i++)
     765          cost_[i] *= 1.0e-100;
    778766        gutsOfSolution(rowActivityWork_, columnActivityWork_);
    779         // so will exit
    780         infeasibilityCost_=1.0e30;
    781       }
    782 
    783       if (infeasibilityCost_<1.0e20) {
    784         infeasibilityCost_ *= 5.0;
    785         changeMade_++; // say change made
    786         handler_->message(CLP_PRIMAL_WEIGHT,messages_)
    787           <<infeasibilityCost_
    788           <<CoinMessageEol;
    789         // put back original costs and then check
    790         createRim(4);
    791         nonLinearCost_->checkInfeasibilities(true);
    792         gutsOfSolution(rowActivityWork_, columnActivityWork_);
    793         problemStatus_=-1; //continue
    794       } else {
    795         // say infeasible
    796         problemStatus_ = 1;
     767        nonLinearCost_=nonLinear;
     768        infeasibilityCost_=saveWeight;
     769        if ((infeasibilityCost_>=1.0e18||
     770             numberDualInfeasibilities_==0)&&perturbation_==101) {
     771          unPerturb(); // stop any further perturbation
     772          numberDualInfeasibilities_=1; // carry on
     773        }
     774        if (infeasibilityCost_>=1.0e20||
     775            numberDualInfeasibilities_==0) {
     776          // we are infeasible - use as ray
     777          delete [] ray_;
     778          ray_ = new double [numberRows_];
     779          memcpy(ray_,dual_,numberRows_*sizeof(double));
     780          // and get feasible duals
     781          infeasibilityCost_=0.0;
     782          createRim(4);
     783          nonLinearCost_->checkInfeasibilities(true);
     784          gutsOfSolution(rowActivityWork_, columnActivityWork_);
     785          // so will exit
     786          infeasibilityCost_=1.0e30;
     787        }
     788       
     789        if (infeasibilityCost_<1.0e20) {
     790          infeasibilityCost_ *= 5.0;
     791          changeMade_++; // say change made
     792          handler_->message(CLP_PRIMAL_WEIGHT,messages_)
     793            <<infeasibilityCost_
     794            <<CoinMessageEol;
     795          // put back original costs and then check
     796          createRim(4);
     797          nonLinearCost_->checkInfeasibilities(true);
     798          gutsOfSolution(rowActivityWork_, columnActivityWork_);
     799          problemStatus_=-1; //continue
     800        } else {
     801          // say infeasible
     802          problemStatus_ = 1;
     803        }
    797804      }
    798805    } else {
Note: See TracChangeset for help on using the changeset viewer.