 Timestamp:
 Mar 5, 2007 2:57:39 PM (13 years ago)
 Location:
 branches/devel/Clp/src
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

branches/devel/Clp/src/Idiot.cpp
r933 r982 147 147 #ifndef OSI_IDIOT 148 148 double averageInfeas = model_>sumPrimalInfeasibilities()/((double) model_>numberRows()); 149 if ( averageInfeas<0.01&&(strategy_&512)!=0)149 if ((averageInfeas<0.01&&(strategy_&512)!=0)(strategy_&8192)!=0) 150 150 crossOver(16+1); 151 151 else … … 842 842 double * saveUpper = NULL; 843 843 double * saveLower = NULL; 844 double * saveRowUpper = NULL; 845 double * saveRowLower = NULL; 846 bool allowInfeasible = (strategy_&8192)!=0; 844 847 if (addAll<3) { 845 848 saveUpper = new double [ncols]; … … 847 850 memcpy(saveUpper,upper,ncols*sizeof(double)); 848 851 memcpy(saveLower,lower,ncols*sizeof(double)); 852 if (allowInfeasible) { 853 saveRowUpper = new double [nrows]; 854 saveRowLower = new double [nrows]; 855 memcpy(saveRowUpper,rowupper,nrows*sizeof(double)); 856 memcpy(saveRowLower,rowlower,nrows*sizeof(double)); 857 double averageInfeas = model_>sumPrimalInfeasibilities()/((double) model_>numberRows()); 858 fixTolerance = CoinMax(fixTolerance,1.0e5*averageInfeas); 859 } 849 860 } 850 861 if (slackStart>=0) { … … 1025 1036 ClpPresolve pinfo; 1026 1037 if (presolve) { 1038 if (allowInfeasible) { 1039 // fix up so will be feasible 1040 double * rhs = new double[nrows]; 1041 memset(rhs,0,nrows*sizeof(double)); 1042 model_>clpMatrix()>times(1.0,colsol,rhs); 1043 double * rowupper = model_>rowUpper(); 1044 double * rowlower= model_>rowLower(); 1045 double sum = 0.0; 1046 for (i=0;i<nrows;i++) { 1047 if (rhs[i]>rowupper[i]) { 1048 sum += rhs[i]rowupper[i]; 1049 rowupper[i]=rhs[i]; 1050 } 1051 if (rhs[i]<rowlower[i]) { 1052 sum += rowlower[i]rhs[i]; 1053 rowlower[i]=rhs[i]; 1054 } 1055 } 1056 printf("sum of infeasibilities %g\n",sum); 1057 delete [] rhs; 1058 } 1027 1059 saveModel = model_; 1028 1060 model_ = pinfo.presolvedModel(*model_,1.0e8,false,5); … … 1051 1083 model_ = saveModel; 1052 1084 saveModel=NULL; 1085 } 1086 if (allowInfeasible) { 1087 memcpy(model_>rowUpper(),saveRowUpper,nrows*sizeof(double)); 1088 memcpy(model_>rowLower(),saveRowLower,nrows*sizeof(double)); 1089 delete [] saveRowUpper; 1090 delete [] saveRowLower; 1091 saveRowUpper = NULL; 1092 saveRowLower = NULL; 1053 1093 } 1054 1094 if (addAll<2) { … … 1074 1114 } 1075 1115 } 1116 delete [] saveUpper; 1117 delete [] saveLower; 1118 saveUpper=NULL; 1119 saveLower=NULL; 1076 1120 } 1077 1121 printf("Time so far %g, %d now added from previous iterations\n", … … 1110 1154 } 1111 1155 } 1156 delete [] saveUpper; 1157 delete [] saveLower; 1158 saveUpper=NULL; 1159 saveLower=NULL; 1112 1160 printf("Time so far %g, %d now added from previous iterations\n", 1113 1161 CoinCpuTime()startTime,n); … … 1177 1225 baseIts *= 10; 1178 1226 maxIts2_ =200+baseIts+5; 1227 maxIts2_=100; 1179 1228 reasonableInfeas_ =((double) nrows)*0.05; 1180 1229 lightWeight_=0; … … 1216 1265 baseIts *= 10; 1217 1266 maxIts2_ =200+baseIts+5; 1267 maxIts2_=100; 1218 1268 reasonableInfeas_ =((double) nrows)*0.05; 1219 1269 lightWeight_=0; 
branches/devel/Clp/src/Idiot.hpp
r933 r982 240 240 512  crossover 241 241 2048  keep lambda across mu change 242 4096  return best solution (not last found) */ 242 4096  return best solution (not last found) 243 8192  always do a presolve in crossover */ 243 244 int lightWeight_; // 0  normal, 1 lightweight 244 245 };
Note: See TracChangeset
for help on using the changeset viewer.