# Changeset 95 for trunk

Ignore:
Timestamp:
Jan 16, 2003 12:49:22 PM (17 years ago)
Message:

Was trying something for dual - didn't really work

Location:
trunk
Files:
8 edited

Unmodified
Removed
• ## trunk/ClpPrimalColumnSteepest.cpp

 r92 #include "CoinHelperFunctions.hpp" #include // bias for free variables #define FREE_BIAS 1.0e1 //############################################################################# // Constructors / Destructor / Assignment if (fabs(value)>1.0e2*tolerance) { // we are going to bias towards free (but only if reasonable) value *= 1000.0; value *= FREE_BIAS; // store square in list if (infeas[iSequence+addSequence]) if (fabs(value)>1.0e2*tolerance) { // we are going to bias towards free (but only if reasonable) value *= 1000.0; value *= FREE_BIAS; // store square in list if (infeas[sequenceOut]) if (fabs(value)>tolerance) { // we are going to bias towards free (but only if reasonable) value *= 1000.0; value *= FREE_BIAS; // store square in list if (infeas[iSequence+addSequence]) if (fabs(value)>1.0e2*tolerance) { // we are going to bias towards free (but only if reasonable) value *= FREE_BIAS; // store square in list infeasible_->quickAdd(iSequence,1.0e6*value*value); infeasible_->quickAdd(iSequence,value*value); } break;
• ## trunk/ClpSimplex.cpp

 r92 } } int ClpSimplex::nextSuperBasic() { if (firstFree_>=0) { int returnValue=firstFree_; int iColumn=firstFree_+1; if (algorithm_>0) { // primal for (;iColumn1.0e20) { setStatus(iColumn,isFree); } else { break; } } } } else { // dual for (;iColumn1.0e2*dualTolerance_) break; } } firstFree_ = iColumn; if (firstFree_==numberRows_+numberColumns_) firstFree_=-1; return returnValue; } else { return -1; } }
• ## trunk/ClpSimplexDual.cpp

 r92 // Copyright (C) 2002, International Business Machines // Corporation and others.  All Rights Reserved. assert(dualOut_<=oldOut); #endif if(dualOut_<0.0&&factorization_->pivots()&& if(dualOut_<-10.0e-8&&factorization_->pivots()&& getStatus(sequenceIn_)!=isFree) { // going backwards - factorize { // get pivot row using whichever method it is pivotRow_=dualRowPivot_->pivotRow(); #if 0 // Doesnt seem to help - think harder about free variables // first see if any free variables and put them in basis int nextFree = nextSuperBasic(); int chosenRow=-1; //nextFree=-1; //off if (nextFree>=0) { // unpack vector and find a good pivot int saveIn=sequenceIn_; sequenceIn_=nextFree; unpack(rowArray_[1]); factorization_->updateColumn(rowArray_[2],rowArray_[1],false); double * work=rowArray_[1]->denseVector(); int number=rowArray_[1]->getNumElements(); int * which=rowArray_[1]->getIndices(); double bestFeasibleAlpha=0.0; int bestFeasibleRow=-1; double bestInfeasibleAlpha=0.0; int bestInfeasibleRow=-1; int i; for (i=0;i1.0e-3) { int iSequence=pivotVariable_[iRow]; double value = solution_[iSequence]; double lower = lower_[iSequence]; double upper = upper_[iSequence]; double infeasibility=0.0; if (value>upper) infeasibility = value-upper; else if (valuebestInfeasibleAlpha&&alpha>1.0e-1) { if (!flagged(iSequence)) { bestInfeasibleAlpha = infeasibility*alpha; bestInfeasibleRow=iRow; } } if (alpha>bestFeasibleAlpha&&(lower>-1.0e20||upper<1.0e20)) { bestFeasibleAlpha = alpha; bestFeasibleRow=iRow; } } } if (bestInfeasibleRow>=0) chosenRow = bestInfeasibleRow; else if (bestFeasibleAlpha>1.0e-2) chosenRow = bestFeasibleRow; if (chosenRow>=0) pivotRow_=chosenRow; sequenceIn_=saveIn; rowArray_[1]->clear(); } if (chosenRow<0) #endif pivotRow_=dualRowPivot_->pivotRow(); if (pivotRow_>=0) { sequenceOut_ = pivotVariable_[pivotRow_]; dualOut_ = lowerOut_ - valueOut_; } else { // odd - it's feasible - go to nearest // odd (could be free) - it's feasible - go to nearest if (valueOut_-lowerOut_
• ## trunk/Makefile.Clp

 r82 # Say Idiot code can use Clp interface CXXFLAGS += -DCLP_IDIOT CXXFLAGS += -DCLP_IDIOT CXXFLAGS += -DUSE_PRESOLVE ifeq (\$(OptLevel),-g) #     CXXFLAGS += -DCLP_DEBUG #    CXXFLAGS += -DPRESOLVE_SUMMARY=1 -DDEBUG_PRESOLVE -DCHECK_CONSISTENCY=1 endif ifeq (\$(OptLevel),-O2) #     CXXFLAGS += -DNDEBUG endif
• ## trunk/PresolveForcing.cpp

 r63 prob->messageHandler()->message(CLP_PRESOLVE_ROWINFEAS, prob->messages()) <
• ## trunk/PresolveSubst.cpp

 r63 acty += rowelsy[k] * sol[col]; } PRESOLVEASSERT(fabs(acty - acts[jrowy]) < 100*ZTOLDP); #if     DEBUG_PRESOLVE PRESOLVEASSERT(fabs(acty - acts[jrowy]) < 100*ZTOLDP); #endif // RECOMPUTING
• ## trunk/Test/unitTest.cpp

 r65 #include "Idiot.hpp" #endif #include #ifndef _MSC_VER #include #include #include #endif static double cpuTime() { double cpu_temp; #if defined(_MSC_VER) unsigned int ticksnow;        /* clock_t is same as int */ ticksnow = (unsigned int)clock(); cpu_temp = (double)((double)ticksnow/CLOCKS_PER_SEC); #else struct rusage usage; getrusage(RUSAGE_SELF,&usage); cpu_temp = usage.ru_utime.tv_sec; cpu_temp += 1.0e-6*((double) usage.ru_utime.tv_usec); #endif return cpu_temp; } //############################################################################# mpsName.push_back("wood1p");min.push_back(true);nRows.push_back(245);nCols.push_back(2594);objValueTol.push_back(1.e-10);objValue.push_back(1.4429024116e+00); mpsName.push_back("woodw");min.push_back(true);nRows.push_back(1099);nCols.push_back(8405);objValueTol.push_back(1.e-10);objValue.push_back(1.3044763331E+00); double timeTaken =0.0; // Loop once for each Mps File for (m=0; m
• ## trunk/include/ClpSimplex.hpp

 r92 /// Sanity check on input rim data (after scaling) - returns true if okay bool sanityCheck(); /** Get next superbasic (primal) or next free (dual), -1 if none */ int nextSuperBasic(); //@} public:
Note: See TracChangeset for help on using the changeset viewer.