Changeset 1043
 Timestamp:
 Jul 2, 2007 9:53:28 AM (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Clp/src/ClpSimplexDual.cpp
r1034 r1043 1199 1199 <<x<<sequenceWithin(sequenceOut_) 1200 1200 <<CoinMessageEol; 1201 #ifdef COIN_DEVELOP 1202 printf("flag a %g %g\n",btranAlpha,alpha_); 1203 #endif 1201 1204 setFlagged(sequenceOut_); 1202 1205 progress_>clearBadTimes(); … … 1321 1324 <<x<<sequenceWithin(sequenceOut_) 1322 1325 <<CoinMessageEol; 1326 #ifdef COIN_DEVELOP 1327 printf("flag b %g\n",alpha_); 1328 #endif 1323 1329 setFlagged(sequenceOut_); 1324 1330 progress_>clearBadTimes(); … … 1535 1541 <<x<<sequenceWithin(sequenceOut_) 1536 1542 <<CoinMessageEol; 1543 #ifdef COIN_DEVELOP 1544 printf("flag c\n"); 1545 #endif 1537 1546 setFlagged(sequenceOut_); 1538 1547 if (!factorization_>pivots()) { … … 1615 1624 } else { 1616 1625 if (iRow<numberRows_) { 1617 #ifdef C LP_DEBUG1618 std::c err<<"Flagged variables at end  infeasible?"<<std::endl;1619 //printf("Probably infeasible  pivot was %g\n",alpha_);1626 #ifdef COIN_DEVELOP 1627 std::cout<<"Flagged variables at end  infeasible?"<<std::endl; 1628 printf("Probably infeasible  pivot was %g\n",alpha_); 1620 1629 #endif 1621 1630 //if (fabs(alpha_)<1.0e4) { … … 3393 3402 <<x<<sequenceWithin(sequenceOut_) 3394 3403 <<CoinMessageEol; 3404 #ifdef COIN_DEVELOP 3405 printf("flag d\n"); 3406 #endif 3395 3407 setFlagged(sequenceOut_); 3396 3408 progress_>clearBadTimes(); … … 3467 3479 <<x<<sequenceWithin(sequenceOut_) 3468 3480 <<CoinMessageEol; 3481 #ifdef COIN_DEVELOP 3482 printf("flag e\n"); 3483 #endif 3469 3484 setFlagged(sequenceOut_); 3470 3485 progress_>clearBadTimes(); … … 3521 3536 double thisObj = objectiveValue_; 3522 3537 double lastObj = progress_>lastObjective(0); 3523 if (lastObj>thisObj+1.0e3*CoinMax(fabs(thisObj),fabs(lastObj))+1.0 3524 &&!ifValuesPass&&firstFree_<0) { 3525 int maxFactor = factorization_>maximumPivots(); 3526 if (maxFactor>10&&numberPivots>1) { 3527 //printf("lastobj %g thisobj %g\n",lastObj,thisObj); 3528 //if (forceFactorization_<0) 3529 //forceFactorization_= maxFactor; 3530 //forceFactorization_ = CoinMax(1,(forceFactorization_>>1)); 3531 forceFactorization_=1; 3532 //printf("Reducing factorization frequency  bad backwards\n"); 3533 unflagVariables = false; 3534 changeMade_++; // say something changed 3535 CoinMemcpyN(saveStatus_,numberColumns_+numberRows_,status_); 3536 CoinMemcpyN(savedSolution_+numberColumns_ , 3537 numberRows_,rowActivityWork_); 3538 CoinMemcpyN(savedSolution_ , 3539 numberColumns_,columnActivityWork_); 3540 // restore extra stuff 3541 int dummy; 3542 matrix_>generalExpanded(this,6,dummy); 3543 // get correct bounds on all variables 3544 resetFakeBounds(); 3545 if(factorization_>pivotTolerance()<0.2) 3546 factorization_>pivotTolerance(0.2); 3547 if (alphaAccuracy_!=1.0) 3548 alphaAccuracy_=2.0; 3549 if (internalFactorize(1)) { 3550 CoinMemcpyN(saveStatus_,numberColumns_+numberRows_,status_); 3551 CoinMemcpyN(savedSolution_+numberColumns_ , 3552 numberRows_,rowActivityWork_); 3553 CoinMemcpyN(savedSolution_ , 3554 numberColumns_,columnActivityWork_); 3538 if(!ifValuesPass&&firstFree_<0) { 3539 if (lastObj>thisObj+1.0e3*CoinMax(fabs(thisObj),fabs(lastObj))+1.0) { 3540 int maxFactor = factorization_>maximumPivots(); 3541 if (maxFactor>10&&numberPivots>1) { 3542 //printf("lastobj %g thisobj %g\n",lastObj,thisObj); 3543 //if (forceFactorization_<0) 3544 //forceFactorization_= maxFactor; 3545 //forceFactorization_ = CoinMax(1,(forceFactorization_>>1)); 3546 forceFactorization_=1; 3547 //printf("Reducing factorization frequency  bad backwards\n"); 3548 unflagVariables = false; 3549 changeMade_++; // say something changed 3550 CoinMemcpyN(saveStatus_,numberColumns_+numberRows_,status_); 3551 CoinMemcpyN(savedSolution_+numberColumns_ , 3552 numberRows_,rowActivityWork_); 3553 CoinMemcpyN(savedSolution_ , 3554 numberColumns_,columnActivityWork_); 3555 3555 // restore extra stuff 3556 3556 int dummy; 3557 3557 matrix_>generalExpanded(this,6,dummy); 3558 // debug 3559 int returnCode = internalFactorize(1); 3560 while (returnCode) { 3561 // ouch 3562 // switch off dense 3563 int saveDense = factorization_>denseThreshold(); 3564 factorization_>setDenseThreshold(0); 3565 // Go to safe 3566 factorization_>pivotTolerance(0.99); 3567 // make sure will do safe factorization 3568 pivotVariable_[0]=1; 3569 returnCode=internalFactorize(2); 3570 factorization_>setDenseThreshold(saveDense); 3571 } 3558 // get correct bounds on all variables 3572 3559 resetFakeBounds(); 3573 } 3574 type = 2; // so will restore weights 3575 // get primal and dual solutions 3576 gutsOfSolution(givenDuals,NULL); 3577 } 3560 if(factorization_>pivotTolerance()<0.2) 3561 factorization_>pivotTolerance(0.2); 3562 if (alphaAccuracy_!=1.0) 3563 alphaAccuracy_=2.0; 3564 if (internalFactorize(1)) { 3565 CoinMemcpyN(saveStatus_,numberColumns_+numberRows_,status_); 3566 CoinMemcpyN(savedSolution_+numberColumns_ , 3567 numberRows_,rowActivityWork_); 3568 CoinMemcpyN(savedSolution_ , 3569 numberColumns_,columnActivityWork_); 3570 // restore extra stuff 3571 int dummy; 3572 matrix_>generalExpanded(this,6,dummy); 3573 // debug 3574 int returnCode = internalFactorize(1); 3575 while (returnCode) { 3576 // ouch 3577 // switch off dense 3578 int saveDense = factorization_>denseThreshold(); 3579 factorization_>setDenseThreshold(0); 3580 // Go to safe 3581 factorization_>pivotTolerance(0.99); 3582 // make sure will do safe factorization 3583 pivotVariable_[0]=1; 3584 returnCode=internalFactorize(2); 3585 factorization_>setDenseThreshold(saveDense); 3586 } 3587 resetFakeBounds(); 3588 } 3589 type = 2; // so will restore weights 3590 // get primal and dual solutions 3591 gutsOfSolution(givenDuals,NULL); 3592 } 3593 } else if (lastObj<thisObj1.0e5*CoinMax(fabs(thisObj),fabs(lastObj))1.0e3) { 3594 numberTimesOptimal_=0; 3595 } 3578 3596 } 3579 3597 #endif … … 4043 4061 } 4044 4062 } 4045 #if 04063 #ifdef COIN_DEVELOP 4046 4064 if (numberFlagged) { 4047 printf("unflagging %d variables  status%d ninf %d nopt %d\n",numberFlagged,tentativeStatus,4048 numberPrimalInfeasibilities_,4065 printf("unflagging %d variables  tentativeStatus %d probStat %d ninf %d nopt %d\n",numberFlagged,tentativeStatus, 4066 problemStatus_,numberPrimalInfeasibilities_, 4049 4067 numberTimesOptimal_); 4050 4068 } … … 4056 4074 if (factorization_>pivotTolerance()<0.9) { 4057 4075 factorization_>pivotTolerance(0.99); 4058 } else if (numberTimesOptimal_<10) { 4076 problemStatus_=1; 4077 } else if (numberTimesOptimal_<3) { 4059 4078 numberTimesOptimal_++; 4079 problemStatus_=1; 4060 4080 } else { 4061 4081 unflagVariables=false; 4062 changeMade_=false; 4063 secondaryStatus_ = 1; // and say probably infeasible 4082 //secondaryStatus_ = 1; // and say probably infeasible 4083 // try primal 4084 problemStatus_=10; 4064 4085 } 4065 4086 }
Note: See TracChangeset
for help on using the changeset viewer.