Changeset 56
- Timestamp:
- Nov 25, 2002 12:10:43 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ClpSimplexDual.cpp
r54 r56 2178 2178 if (rowLowerWork_[iRow]>-largeValue_) { 2179 2179 if (fabs(rowLowerWork_[iRow])<fabs(rowUpperWork_[iRow])) 2180 value *= drand48();2180 value *= CoinDrand48(); 2181 2181 else 2182 value *= - drand48();2182 value *= -CoinDrand48(); 2183 2183 } else if (rowUpperWork_[iRow]<largeValue_) { 2184 value *= - drand48();2184 value *= -CoinDrand48(); 2185 2185 } else { 2186 2186 value=0.0; … … 2195 2195 if (fabs(columnLowerWork_[iColumn])< 2196 2196 fabs(columnUpperWork_[iColumn])) 2197 value *= drand48();2197 value *= CoinDrand48(); 2198 2198 else 2199 value *= - drand48();2199 value *= -CoinDrand48(); 2200 2200 } else if (columnUpperWork_[iColumn]<largeValue_) { 2201 value *= - drand48();2201 value *= -CoinDrand48(); 2202 2202 } else { 2203 2203 value=0.0; -
trunk/ClpSimplexPrimal.cpp
r54 r56 1467 1467 double lowerValue=lower_[i], upperValue=upper_[i]; 1468 1468 if (upperValue>lowerValue+primalTolerance_) { 1469 double value = drand48()*perturbation;1469 double value = CoinDrand48()*perturbation; 1470 1470 if (lowerValue>-1.0e20) 1471 1471 lowerValue -= value * (max(1.0,1.0e-3*fabs(lowerValue))); -
trunk/Makefile.Clp
r50 r56 44 44 LIBSRC += PresolveUseless.cpp 45 45 46 #LIBSRC += Idiot.cpp47 #LIBSRC += IdiSolve.cpp46 LIBSRC += Idiot.cpp 47 LIBSRC += IdiSolve.cpp 48 48 49 49 ############################################################################## … … 57 57 58 58 # Say Idiot code can use Clp interface 59 #CXXFLAGS += -DCLP_IDIOT59 CXXFLAGS += -DCLP_IDIOT 60 60 CXXFLAGS += -DUSE_PRESOLVE 61 61 ifeq ($(OptLevel),-g) -
trunk/PresolveDoubleton.cpp
r55 r56 457 457 458 458 // don't bother with fixed variables 459 if ( !fabs(cup[icolx] - clo[icolx]) < ZTOLDP&&460 !fabs(cup[icoly] - clo[icoly]) < ZTOLDP) {459 if ((!fabs(cup[icolx] - clo[icolx]) < ZTOLDP) && 460 (!fabs(cup[icoly] - clo[icoly]) < ZTOLDP)) { 461 461 double coeffx, coeffy; 462 462 /* find this row in each of the columns */ -
trunk/PresolveDupcol.cpp
r55 r56 503 503 double x_k_sol = sol[icol2]; 504 504 505 PRESOLVEASSERT(l_j + u_k <= l_k + u_j);506 505 prob->setColumnStatus(icol,prob->getColumnStatus(icol2)); 507 506 if (x_k_sol <= l_k + u_j) { -
trunk/PresolveEmpty.cpp
r55 r56 188 188 memset(colmapping,0,ncols2*sizeof(int)); 189 189 char *cdone = prob->cdone_; 190 191 for ( intaction_i = 0; action_i < nactions; action_i++) {190 int action_i; 191 for (action_i = 0; action_i < nactions; action_i++) { 192 192 const action *e = &actions[action_i]; 193 193 int jcol = e->jcol; … … 222 222 delete [] colmapping; 223 223 224 for ( intaction_i = 0; action_i < nactions; action_i++) {224 for (action_i = 0; action_i < nactions; action_i++) { 225 225 const action *e = &actions[action_i]; 226 226 int jcol = e->jcol; -
trunk/PresolveFixed.cpp
r55 r56 53 53 for (int ckc=0; ckc<nfcols; ckc++) { 54 54 int j = fcols[ckc]; 55 56 PRESOLVEASSERT(/*hincol[j] > 0 &&*/ cup[j] == clo[j]);57 55 58 56 double sol = clo[j]; … … 209 207 cs = k; 210 208 211 PRESOLVEASSERT(rdone[row]);212 213 209 if (-PRESOLVE_INF < rlo[row]) 214 210 rlo[row] += coeff * thesol; -
trunk/PresolveForcing.cpp
r55 r56 21 21 } 22 22 #endif 23 static void implied_bounds1(PresolveMatrix * prob,const double *rowels,24 const int *mrstrt,25 const int *hrow,26 const int *hinrow,27 const double *clo, const double *cup,28 const int *hcol,29 int ncols,30 const double *rlo, const double *rup,31 const char *integerType,32 int nrows,33 double *ilbound, double *iubound);34 35 23 36 24 /*static*/ void implied_bounds(const double *els, … … 406 394 const int *rowcols = f->rowcols; 407 395 const double *bounds= f->bounds; 408 409 for (int k=0; k<nlo; k++) { 396 int k; 397 398 for (k=0; k<nlo; k++) { 410 399 int jcol = rowcols[k]; 411 400 cup[jcol] = bounds[k]; … … 413 402 } 414 403 415 for ( intk=nlo; k<ninrow; k++) {404 for (k=nlo; k<ninrow; k++) { 416 405 int jcol = rowcols[k]; 417 406 clo[jcol] = bounds[k]; … … 433 422 int whacked = -1; 434 423 double whack = 0.0; 435 for ( intk=0; k<ninrow; k++) {424 for (k=0; k<ninrow; k++) { 436 425 int jcol = rowcols[k]; 437 426 CoinBigIndex kk = presolve_find_row2(irow, mcstrt[jcol], hincol[jcol], hrow, link); … … 453 442 rowduals[irow] = whack; 454 443 455 for ( intk=0; k<ninrow; k++) {444 for (k=0; k<ninrow; k++) { 456 445 int jcol = rowcols[k]; 457 446 CoinBigIndex kk = presolve_find_row2(irow, mcstrt[jcol], hincol[jcol], hrow, link); … … 465 454 466 455 467 456 #if 0 468 457 // Determine the maximum and minimum values the constraint sums 469 458 // may take, given the bounds on the variables. … … 743 732 } 744 733 745 for ( intk=0; k<ninrow; k++) {734 for (k=0; k<ninrow; k++) { 746 735 int jcol = rowcols[k]; 747 736 CoinBigIndex kk = presolve_find_row(irow, mcstrt[jcol], mcstrt[jcol] + hincol[jcol], hrow); … … 784 773 } 785 774 #endif 786 787 788 775 #endif 776 777 778 -
trunk/PresolveImpliedFree.cpp
r55 r56 448 448 int jcol = rowcols[k]; 449 449 PRESOLVE_STMT(CoinBigIndex kk = presolve_find_row2(irow, mcstrt[jcol], hincol[jcol], hrow, link)); 450 PRESOLVEASSERT(colels[kk] == rowels[k]);451 450 act += rowels[k] * sol[jcol]; 452 451 } -
trunk/PresolveIsolated.cpp
r55 r56 136 136 rup[irow] = this->rup_; 137 137 rlo[irow] = this->rlo_; 138 int k; 138 139 139 for ( intk=0; k<this->ninrow_; k++) {140 for (k=0; k<this->ninrow_; k++) { 140 141 int jcol = this->rowcols_[k]; 141 142 -
trunk/PresolveSingleton.cpp
r55 r56 257 257 double coeff = f->coeff; 258 258 int jcol = f->col; 259 260 /* the column was in the reduced problem */261 PRESOLVEASSERT(cdone[jcol] && rdone[irow]==DROP_ROW);262 259 263 260 rlo[irow] = f->rlo; -
trunk/PresolveSubst.cpp
r55 r56 1077 1077 // const double ztoldj = prob->ztoldj_; 1078 1078 const double maxmin = prob->maxmin_; 1079 int k; 1079 1080 1080 1081 for (const action *f = &actions[nactions-1]; actions<=f; f--) { … … 1161 1162 double sol0 = rloy; 1162 1163 sol[icol] = 0.0; // to avoid condition in loop 1163 for ( intk = 0; k<ninrowy; ++k) {1164 for (k = 0; k<ninrowy; ++k) { 1164 1165 int jcolx = rowcolsy[k]; 1165 1166 double coeffx = rowelsy[k]; … … 1189 1190 // (with the exception of icol, which was deleted); 1190 1191 // the other rows *must* contain these cols 1191 for ( intk = 0; k<ninrowy; ++k) {1192 for (k = 0; k<ninrowy; ++k) { 1192 1193 int col = rowcolsy[k]; 1193 1194 … … 1217 1218 1218 1219 if (jrowx != jrowy) 1219 for ( intk = 0; k<ninrowx; ++k) {1220 for (k = 0; k<ninrowx; ++k) { 1220 1221 int col = rowcolsx[k]; 1221 1222 CoinBigIndex kcolx = presolve_find_row3(jrowx, mcstrt[col], hincol[col], hrow, link); … … 1247 1248 1248 1249 // finally, add original rowy elements 1249 for ( intk = 0; k<ninrowy; ++k) {1250 for (k = 0; k<ninrowy; ++k) { 1250 1251 int col = rowcolsy[k]; 1251 1252 … … 1279 1280 // DEBUG CHECK 1280 1281 double acty = 0.0; 1281 for ( intk = 0; k<ninrowy; ++k) {1282 for (k = 0; k<ninrowy; ++k) { 1282 1283 int col = rowcolsy[k]; 1283 1284 acty += rowelsy[k] * sol[col]; … … 1297 1298 1298 1299 double actx = 0.0; 1299 for ( intk = 0; k<ninrowx; ++k) {1300 for (k = 0; k<ninrowx; ++k) { 1300 1301 int col = rowcolsx[k]; 1301 1302 actx += rowelsx[k] * sol[col]; -
trunk/PresolveTighten.cpp
r55 r56 337 337 // adjust to just meet newrlo (solve for correction) 338 338 double new_correction = (newrlo - activity) / coeff; 339 PRESOLVEASSERT((iflag == 1) == (correction < new_correction));340 339 correction = new_correction; 341 340 } else if (activity + correction * coeff > newrup) { … … 343 342 344 343 double new_correction = (newrup - activity) / coeff; 345 PRESOLVEASSERT((iflag == 1) == (correction < new_correction));346 344 correction = new_correction; 347 345 } … … 349 347 350 348 sol[jcol] += correction; 351 PRESOLVEASSERT(clo[jcol] - ztolzb < sol[jcol] &&352 sol[jcol] <= cup[jcol] + ztolzb);353 349 354 350 // by construction, the last row corrected (if there was one) … … 367 363 acts[irow] += correction * coeff; 368 364 369 // ? there isn't really a tolerance for tihs370 PRESOLVEASSERT(rlo[irow] - ztolzb <= acts[irow] &&371 acts[irow] <= rup[irow] + ztolzb);372 365 } 373 366 -
trunk/PresolveUseless.cpp
r55 r56 137 137 // I don't know if this is always true 138 138 PRESOLVEASSERT(prob->getRowStatus(irow)==PrePostsolveMatrix::basic); 139 PRESOLVEASSERT(rowduals[irow] == 0.0);140 139 // rcosts are unaffected since rowdual is 0 141 140 -
trunk/Test/Makefile.test
r50 r56 25 25 CXXFLAGS += $(OPTFLAG) 26 26 CXXFLAGS += -DUSE_PRESOLVE 27 #CXXFLAGS += -DCLP_IDIOT27 CXXFLAGS += -DCLP_IDIOT 28 28 #ifeq ($(OPTFLAG),-g) 29 29 # CXXFLAGS += -DCLP_DEBUG -DPRESOLVE_SUMMARY=1 -
trunk/include/PresolveMatrix.hpp
r55 r56 52 52 #define PRESOLVEASSERT(x) ((x) ? 1 : ((std::cerr<< "FAILED ASSERTION at line "<< __LINE__ << ": " #x "\n"), abort(), 0)) 53 53 #else 54 #define PRESOLVEASSERT(x) 54 #define PRESOLVEASSERT(x) assert(x) 55 55 #define PRESOLVE_STMT(s) 56 56 #endif
Note: See TracChangeset
for help on using the changeset viewer.