# Changeset 204 for branches

Ignore:
Timestamp:
Sep 3, 2003 5:42:52 PM (17 years ago)
Message:

Faster?

Location:
branches/pre
Files:
9 edited

Unmodified
Removed
• ## branches/pre/ClpModel.cpp

 r200 return newArray; } // Replace Clp Matrix (current is not deleted) void ClpModel::replaceMatrix( ClpMatrixBase * matrix) { matrix_=matrix; } // Subproblem constructor ClpModel::ClpModel ( const ClpModel * rhs,
• ## branches/pre/ClpSimplex.cpp

 r199 changeMade_++; // something has happened // incoming variable handler_->message(CLP_SIMPLEX_HOUSE1,messages_) <
• ## branches/pre/ClpSimplexDual.cpp

 r197 if (perturbation_>100) return; //perturbed already int iRow,iColumn; bool modifyRowCosts=true; // dual perturbation double perturbation=1.0e-20; // maximum fraction of cost to perturb double maximumFraction = 1.0e-4; double factor=1.0e-8; // If > 70 then do not do rows if (perturbation_>70) { modifyRowCosts=false; perturbation_ -= 20; //printf("Row costs not modified, "); } if (perturbation_>50) { // Experiment // factor could be 1.0e-8 to 1.0 (51,56,61,66 are 1.0e-8) // maximumFraction could be 1.0e-6 to 1.0e-3 (51-55 are 1.0e-6) double f[]={1.0e-8,1.0e-6,1.0e-4,1.0e-2,1.0}; double m[]={1.0e-6,1.0e-5,1.0e-4,1.0e-3}; factor = f[((perturbation_-1)%5)]; maximumFraction = m[(perturbation_-51)/5]; } int iRow,iColumn; if (perturbation_>=50) { perturbation = 1.0e-4; perturbation = 1.0e-8; for (iRow=0;iRowmessage(CLP_SIMPLEX_PERTURB,messages_) <-largeValue_) { if (fabs(rowLowerWork_[iRow])-largeValue_) { if (fabs(rowLowerWork_[iRow])-largeValue_) { if (fabs(columnLowerWork_[iColumn])< fabs(columnUpperWork_[iColumn])) value *= CoinDrand48(); else value *= -CoinDrand48(); } else if (columnUpperWork_[iColumn]-largeValue_) { if (fabs(columnLowerWork_[iColumn])< fabs(columnUpperWork_[iColumn])) value *= CoinDrand48(); else value *= -CoinDrand48(); } else if (columnUpperWork_[iColumn]
• ## branches/pre/ClpSimplexPrimal.cpp

 r190 upperValue=0.0; double value = max(lowerValue,upperValue); value = min(value,upper_[i]-lower_[i]); perturbation = max(perturbation,value); } <lowerValue+primalTolerance_) { double value = CoinDrand48()*perturbation; if (lowerValue>-1.0e20&&lowerValue) lowerValue -= value * (max(1.0,1.0e-5*fabs(lowerValue))); if (upperValue<1.0e20&&upperValue) upperValue += value * (max(1.0,1.0e-5*fabs(upperValue))); } lower_[i]=lowerValue; upper_[i]=upperValue; } for (;ilowerValue+primalTolerance_) { if (lowerValue>-1.0e20) lowerValue -= value * (max(1.0,1.0e-3*fabs(lowerValue))); lowerValue -= value * (max(1.0,1.0e-5*fabs(lowerValue))); if (upperValue<1.0e20) upperValue += value * (max(1.0,1.0e-3*fabs(upperValue))); upperValue += value * (max(1.0,1.0e-5*fabs(upperValue))); } else if (upperValue>0.0) { lowerValue -= value * (max(1.0,1.0e-5*fabs(lowerValue))); upperValue -= value * (max(1.0,1.0e-5*fabs(lowerValue))); } else if (upperValue<0.0) { lowerValue += value * (max(1.0,1.0e-5*fabs(lowerValue))); upperValue += value * (max(1.0,1.0e-5*fabs(lowerValue))); } else { } lower_[i]=lowerValue;

 r203 ClpObjective * saveObj = objectiveAsObject(); setObjectivePointer(info->originalObjective()); factorization_->setBiasLU(0); if (!startup(1)) { upperIn_=upper_[sequenceIn_]; dualIn_=dj_[sequenceIn_]; valueIn_=solution_[sequenceIn_]; valueIn_=solution_[sequenceIn_]; if (dualIn_>0.0) directionIn_ = -1;
• ## branches/pre/Makefile.Clp

 r203 # Static or shared libraries should be built (STATIC or SHARED)? LibType := SHARED #LibType := STATIC # Select optimization (-O or -g). -O will be automatically bumped up to the
• ## branches/pre/Test/ClpMain.cpp

 r196 #include "ClpFactorization.hpp" #include "ClpSimplex.hpp" #include "ClpPackedMatrix.hpp" #include "ClpPlusMinusOneMatrix.hpp" #include "ClpNetworkMatrix.hpp" #include "ClpDualRowSteepest.hpp" #include "ClpDualRowDantzig.hpp" DIRECTION=201,DUALPIVOT,SCALING,ERRORSALLOWED,KEEPNAMES,SPARSEFACTOR, PRIMALPIVOT,PRESOLVE,CRASH, PRIMALPIVOT,PRESOLVE,CRASH,BIASLU, DIRECTORY=301,IMPORT,EXPORT,RESTORE,SAVE,DUALSIMPLEX,PRIMALSIMPLEX,BAB, MAXIMIZE,MINIMIZE,EXIT,STDIN,UNITTEST,NETLIB_DUAL,NETLIB_PRIMAL,SOLUTION, TIGHTEN,FAKEBOUND,VERSION, TIGHTEN,FAKEBOUND,VERSION,PLUSMINUS,NETWORK, INVALID=1000 parameters[numberParameters++]= ClpItem("pert!urbation","Method of perturbation", -50,102,PERTURBATION); -5000,102,PERTURBATION); parameters[numberParameters++]= ClpItem("direction","Minimize or Maximize", parameters[numberParameters-1].append("off"); parameters[numberParameters++]= ClpItem("biasLU","Whether factorization biased towards U", "UU",BIASLU); parameters[numberParameters-1].append("UX"); parameters[numberParameters-1].append("LX"); parameters[numberParameters-1].append("LL"); parameters[numberParameters++]= ClpItem("error!sAllowed","Whether to allow import errors", "off",ERRORSALLOWED); ClpItem("tight!en","Poor person's preSolve for now", TIGHTEN); parameters[numberParameters++]= ClpItem("plus!Minus","Tries to make +- 1", PLUSMINUS); parameters[numberParameters++]= ClpItem("network","Tries to make network", NETWORK); parameters[numberParameters++]= ClpItem("sol!ution","Prints solution to file", ClpSimplex * models = new ClpSimplex[1]; bool * goodModels = new bool[1]; int getNewMatrix=0; models->setPerturbation(73); #ifdef READLINE currentModel = models; models[iModel].setSparseFactorization((1-action)!=0); break; case BIASLU: models[iModel].factorization()->setBiasLU(action); break; case ERRORSALLOWED: allowImportErrors = action; if (goodModels[iModel]) { int saveMaxIterations = models[iModel].maximumIterations(); int numberIterations=0; time1 = CoinCpuTime(); ClpMatrixBase * saveMatrix=NULL; #ifdef USE_PRESOLVE ClpSimplex * model2 = models+iModel; } } if (getNewMatrix) { saveMatrix = model2->clpMatrix(); ClpPackedMatrix* clpMatrix = dynamic_cast< ClpPackedMatrix*>(saveMatrix); if (clpMatrix) { if (getNewMatrix==1) { ClpPlusMinusOneMatrix * newMatrix = new ClpPlusMinusOneMatrix(*(clpMatrix->matrix())); if (newMatrix->getIndices()) { std::cout<<"** Matrix is valid +- one"<replaceMatrix(newMatrix); } else { std::cout<<"** Matrix is NOT valid +- one"<matrix())); if (newMatrix->getIndices()) { std::cout<<"** Matrix is valid network"<replaceMatrix(newMatrix); } else { std::cout<<"** Matrix is NOT valid network"<factorizationFrequency()==200) { // User did not touch preset model2->setFactorizationFrequency(100+model2->numberRows()/100); } if (type==DUALSIMPLEX) { if (doIdiot<0) } #endif int savePerturbation = model2->perturbation(); if (savePerturbation==73) model2->setPerturbation(100); model2->primal(1); } model2->setPerturbation(savePerturbation); } if (saveMatrix) { // delete and replace delete model2->clpMatrix(); model2->replaceMatrix(saveMatrix); } numberIterations = model2->numberIterations(); if (preSolve) { #if 0 models[iModel].primal(1); models[iModel].setPerturbation(savePerturbation); numberIterations += models[iModel].numberIterations(); } #ifdef CLP_DEBUG_not std::cout<<"Result "<
• ## branches/pre/Test/Makefile.test

 r203 @mkdir -p \$(TARGETDIR) @rm -f \$@ #       \$(CXX) -static \$(CXXFLAGS) -o \$@ \$(TESTOBJ) \$(LDFLAGS) \$(SYSLD) -lm \$(CXX) \$(CXXFLAGS) -o \$@ \$(TESTOBJ) \$(LDFLAGS) \$(SYSLD) -lm \${CP} \$@ ..
• ## branches/pre/include/ClpModel.hpp

 r200 /// Clp Matrix inline ClpMatrixBase * clpMatrix() const     { return matrix_; } /** Replace Clp Matrix (current is not deleted and new is used) So up to user to delete one */ void replaceMatrix(ClpMatrixBase * matrix); /// Objective value inline double objectiveValue() const {
Note: See TracChangeset for help on using the changeset viewer.