Changeset 1206 for trunk/Clp


Ignore:
Timestamp:
May 28, 2008 7:02:06 AM (12 years ago)
Author:
forrest
Message:

new diving and fix ClpSimplex? bug

Location:
trunk/Clp/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/CbcOrClpParam.cpp

    r1199 r1206  
    15681568  parameters[numberParameters-1].setIntValue(-1);
    15691569  parameters[numberParameters++]=
    1570       CbcOrClpParam("Diving","Whether to try Diving heuristics",
    1571                     "off",DIVING);
     1570      CbcOrClpParam("DivingS!ome","Whether to try Diving heuristics",
     1571                    "off",DIVINGA);
    15721572  parameters[numberParameters-1].append("V");
    15731573  parameters[numberParameters-1].append("G");
     
    15881588    (
    15891589     "This switches on various diving heuristics. \
    1590 C - Coefficient, F - Fractional, G - Guided, V - VectorLength."
    1591      );
     1590C - Coefficient, F - Fractional, G - Guided, V - VectorLength. \
     1591You may prefer to use individual on/off which has divingC,F,G and V \
     1592and also divingL and P"
     1593     );
     1594  parameters[numberParameters++]=
     1595      CbcOrClpParam("DivingC!oefficient","Whether to try DiveCoefficient",
     1596                    "off",DIVINGC);
     1597  parameters[numberParameters-1].append("on");
     1598  parameters[numberParameters++]=
     1599      CbcOrClpParam("DivingF!ractional","Whether to try DiveFractional",
     1600                    "off",DIVINGF);
     1601  parameters[numberParameters-1].append("on");
     1602  parameters[numberParameters++]=
     1603      CbcOrClpParam("DivingG!uided","Whether to try DiveGuided",
     1604                    "off",DIVINGG);
     1605  parameters[numberParameters-1].append("on");
     1606  parameters[numberParameters++]=
     1607      CbcOrClpParam("DivingL!ineSearch","Whether to try DiveLineSearch",
     1608                    "off",DIVINGL);
     1609  parameters[numberParameters-1].append("on");
     1610  parameters[numberParameters++]=
     1611      CbcOrClpParam("DivingP!seudoCost","Whether to try DivePseudoCost",
     1612                    "off",DIVINGP);
     1613  parameters[numberParameters-1].append("on");
     1614  parameters[numberParameters++]=
     1615      CbcOrClpParam("DivingV!ectorLength","Whether to try DiveVectorLength",
     1616                    "off",DIVINGV);
     1617  parameters[numberParameters-1].append("on");
    15921618  parameters[numberParameters++]=
    15931619    CbcOrClpParam("doH!euristic","Do heuristics before any preprocessing",
  • trunk/Clp/src/CbcOrClpParam.hpp

    r1197 r1206  
    7979    ROUNDING,SOLVER,CLIQUECUTS,COSTSTRATEGY,FLOWCUTS,MIXEDCUTS,
    8080    TWOMIRCUTS,PREPROCESS,FPUMP,GREEDY,COMBINE,LOCALTREE,SOS,
    81     LANDPCUTS,RINS,RESIDCUTS,RENS,DIVING,
     81    LANDPCUTS,RINS,RESIDCUTS,RENS,DIVINGA,DIVINGC,DIVINGF,DIVINGG,DIVINGL,
     82    DIVINGP,DIVINGV,
    8283   
    8384    DIRECTORY=301,DIRSAMPLE,DIRNETLIB,DIRMIPLIB,IMPORT,EXPORT,RESTORE,SAVE,DUALSIMPLEX,PRIMALSIMPLEX,EITHERSIMPLEX,
  • trunk/Clp/src/ClpSimplex.cpp

    r1205 r1206  
    96919691  secondaryStatus_ = rhs. secondaryStatus_;
    96929692  if (numberRows_ == rhs.numberRows_ && numberColumns_ == rhs.numberColumns_&& !justStatus) {
    9693     delete [] status_;
    96949693    if (rhs.status_) {
    9695       status_ = CoinCopyOfArray(rhs.status_,numberRows_+numberColumns_);
     9694      if (status_)
     9695        CoinMemcpyN(rhs.status_,numberRows_+numberColumns_,status_);
     9696      else
     9697        status_ = CoinCopyOfArray(rhs.status_,numberRows_+numberColumns_);
    96969698    } else {
     9699      delete [] status_;
    96979700      status_ = NULL;
    96989701    }
     
    98099812  int saveMaxIterations = maximumIterations();
    98109813  setMaximumIterations(100+5*(numberRows_+numberColumns_));
     9814#if 0
     9815  bool onOptimal=true;
     9816  double optVal[133];
     9817  {
     9818    memset(optVal,0,sizeof(optVal));
     9819#if 0
     9820    int intIndicesV[]={61,62,65,66,67,68,69,70};
     9821    double intSolnV[] = {4.,21.,4.,4.,6.,1.,25.,8.};
     9822    int vecLen = sizeof(intIndicesV)/sizeof(int);
     9823    for (int i=0;i<vecLen;i++) {
     9824      optVal[intIndicesV[i]]=intSolnV[i];
     9825    }
     9826#else
     9827    int intIndicesAt1[]={ 0,18,25,36,44,59,61,77,82,93 };
     9828    int vecLen = sizeof(intIndicesAt1)/sizeof(int);
     9829    for (int i=0;i<vecLen;i++) {
     9830      optVal[intIndicesAt1[i]]=1;
     9831    }
     9832#endif
     9833  }
     9834  if (numberColumns_==100) {
     9835    const char * integerType = integerInformation();
     9836    for (int i=0;i<100;i++) {
     9837      if (integerType[i]) {
     9838        if (columnLower_[i]>optVal[i]||columnUpper_[i]<optVal[i]) {
     9839          onOptimal=false;
     9840          break;
     9841        }
     9842      }
     9843    }
     9844    if (onOptimal)
     9845      printf("On optimal path fathom\n");
     9846  }
     9847#endif
    98119848  if (info->presolveType_) {
    98129849    // crunch down
     
    1005110088  bool backtrack=false;
    1005210089  bool printing = handler_->logLevel()>0;
    10053   double optVal[133];
    10054   {
    10055     memset(optVal,0,sizeof(optVal));
    10056     int intIndicesV[]={61,62,65,66,67,68,69,70};
    10057     double intSolnV[] = {4.,21.,4.,4.,6.,1.,25.,8.};
    10058     int vecLen = sizeof(intIndicesV)/sizeof(int);
    10059     for (int i=0;i<vecLen;i++) {
    10060       optVal[intIndicesV[i]]=intSolnV[i];
    10061     }
    10062   }
    1006310090  while (depth>=0) {
    1006410091    // If backtrack get to correct depth
     
    1010410131                 columnLower_[iColumn],columnUpper_[iColumn]);
    1010510132      }
    10106     }
    10107     bool onOptimal=true;
    10108     if (numberColumns_==133) {
    10109       const char * integerType = integerInformation();
    10110       for (int i=0;i<133;i++) {
    10111         if (integerType[i]) {
    10112           if (columnLower_[i]>optVal[i]||columnUpper_[i]<optVal[i]) {
    10113             onOptimal=false;
    10114             break;
    10115           }
    10116         }
    10117       }
    10118       if (onOptimal)
    10119         printf("On optimal path\n");
    1012010133    }
    1012110134    // solve
     
    1024610259        nodes[maxDepth++]=node;
    1024710260      }
    10248 
     10261#if 0
    1024910262    if (numberColumns_==133&&onOptimal) {
    1025010263      const char * integerType = integerInformation();
     
    1026010273      assert (onOptimal);
    1026110274    }
    10262 
     10275#endif
    1026310276      if (node->sequence()<0) {
    1026410277        // solution
Note: See TracChangeset for help on using the changeset viewer.