Changeset 744
 Timestamp:
 Mar 29, 2006 5:39:11 AM (14 years ago)
 Location:
 trunk
 Files:

 6 edited
Legend:
 Unmodified
 Added
 Removed

trunk/ClpGubDynamicMatrix.cpp
r605 r744 1961 1961 } 1962 1962 /* Just for debug  may be extended to other matrix types later. 1963 Returns number of primal infeasibilities.1963 Returns number and sum of primal infeasibilities. 1964 1964 */ 1965 1965 int 1966 ClpGubDynamicMatrix::checkFeasible(ClpSimplex * model ) const1966 ClpGubDynamicMatrix::checkFeasible(ClpSimplex * model,double & sum) const 1967 1967 { 1968 1968 int numberRows = model_>numberRows(); … … 1981 1981 const double * rowLower = model_>rowLower(); 1982 1982 const double * rowUpper = model_>rowUpper(); 1983 sum=0.0; 1983 1984 for (iRow=0;iRow<numberRows;iRow++) { 1984 1985 double value=smallSolution[numberColumns+iRow]; … … 1988 1989 // iRow,rowLower[iRow],value,rowUpper[iRow]); 1989 1990 numberInfeasible++; 1991 sum += CoinMax(rowLower[iRow]value,valuerowUpper[iRow]); 1990 1992 } 1991 1993 rhs[iRow]=value; … … 2000 2002 // iColumn,columnLower[iColumn],value,columnUpper[iColumn]); 2001 2003 numberInfeasible++; 2004 sum += CoinMax(columnLower[iColumn]value,valuecolumnUpper[iColumn]); 2002 2005 } 2003 2006 for (CoinBigIndex j=startColumn[iColumn]; 
trunk/ClpMatrixBase.cpp
r653 r744 424 424 } 425 425 /* Just for debug if odd type matrix. 426 Returns number of primal infeasibilities.426 Returns number and sum of primal infeasibilities. 427 427 */ 428 428 int 429 ClpMatrixBase::checkFeasible(ClpSimplex * model ) const429 ClpMatrixBase::checkFeasible(ClpSimplex * model, double & sum) const 430 430 { 431 431 int numberRows = model>numberRows(); … … 443 443 solution = model>solutionRegion(0); 444 444 double tolerance = model>primalTolerance()*1.01; 445 sum=0.0; 445 446 for (iRow=0;iRow<numberRows;iRow++) { 446 447 double value=rhs[iRow]; … … 453 454 value>rowUpper[iRow]+tolerance) { 454 455 numberInfeasible++; 456 sum += CoinMax(rowLower[iRow]value,valuerowUpper[iRow]); 455 457 } 456 458 if (value2>rowLower[iRow]+tolerance&& … … 468 470 value>columnUpper[iColumn]+tolerance) { 469 471 numberInfeasible++; 472 sum += CoinMax(columnLower[iColumn]value,valuecolumnUpper[iColumn]); 470 473 } 471 474 if (value>columnLower[iColumn]+tolerance&& 
trunk/ClpSimplexNonlinear.cpp
r694 r744 3189 3189 #endif 3190 3190 lastObjective = objValue; 3191 if (targetDrop< 1.0e5&&goodMove&&iPass) {3191 if (targetDrop<CoinMax(1.0e8,CoinMin(1.0e6,1.0e6*fabs(objValue)))&&goodMove&&iPass>3) { 3192 3192 if (handler_>logLevel()>1) 3193 3193 printf("Exiting on target drop %g\n",targetDrop); 
trunk/ClpSimplexPrimal.cpp
r742 r744 742 742 if (numberThrownOut 743 743 (sumInfeasibility>1.0e7&&sumInfeasibility>100.0*lastSumInfeasibility 744 &&factorization_>pivotTolerance()<0.11) ) {744 &&factorization_>pivotTolerance()<0.11)(largestPrimalError_>1.0e10&&largestDualError_>1.0e10)) { 745 745 problemStatus_=tentativeStatus; 746 746 doFactorization=true; 747 if (numberPivots) { 748 // go back 749 numberThrownOut=1; 750 // trouble  restore solution 751 CoinMemcpyN(saveStatus_,numberColumns_+numberRows_,status_); 752 CoinMemcpyN(savedSolution_+numberColumns_ , 753 numberRows_,rowActivityWork_); 754 CoinMemcpyN(savedSolution_ , 755 numberColumns_,columnActivityWork_); 756 // restore extra stuff 757 matrix_>generalExpanded(this,6,dummy); 758 forceFactorization_=1; // a bit drastic but .. 759 // Go to safe 760 factorization_>pivotTolerance(0.99); 761 pivotRow_=1; // say no weights update 762 changeMade_++; // say change made 763 if (numberPivots==1) { 764 // throw out something 765 if (sequenceIn_>=0&&getStatus(sequenceIn_)!=basic) { 766 setFlagged(sequenceIn_); 767 } else if (sequenceOut_>=0&&getStatus(sequenceOut_)!=basic) { 768 setFlagged(sequenceOut_); 769 } 770 } 771 numberPivots=0; 772 } 747 773 } 748 774 } … … 2594 2620 #if CLP_DEBUG >1 2595 2621 { 2596 int ninf= matrix_>checkFeasible(this); 2622 double sum; 2623 int ninf= matrix_>checkFeasible(this,sum); 2597 2624 if (ninf) 2598 2625 printf("infeas %d\n",ninf); 
trunk/include/ClpGubDynamicMatrix.hpp
r439 r744 53 53 const double * x, double * y) const; 54 54 /** Just for debug 55 Returns number of primal infeasibilities. Recomputes keys55 Returns sum and number of primal infeasibilities. Recomputes keys 56 56 */ 57 virtual int checkFeasible(ClpSimplex * model ) const;57 virtual int checkFeasible(ClpSimplex * model,double & sum) const; 58 58 //@} 59 59 
trunk/include/ClpMatrixBase.hpp
r653 r744 234 234 /** Just for debug if odd type matrix. 235 235 Returns number of primal infeasibilities. */ 236 virtual int checkFeasible(ClpSimplex * model ) const ;236 virtual int checkFeasible(ClpSimplex * model,double & sum) const ; 237 237 /// Returns reduced cost of a variable 238 238 double reducedCost(ClpSimplex * model,int sequence) const;
Note: See TracChangeset
for help on using the changeset viewer.