Changeset 1948 for trunk/Cbc/src


Ignore:
Timestamp:
Jul 30, 2013 4:18:54 PM (6 years ago)
Author:
forrest
Message:

yet more changes for dubious idea

Location:
trunk/Cbc/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicDW.cpp

    r1946 r1948  
    429429             lastObjective_>bestObjective_+1.0e-3 ? "improving" : "");
    430430    if ((pass_%10)==9) {
    431       for (int iImp=1;iImp<numberImproving;iImp++) {
     431      for (int iImp=CoinMax(1,numberImproving-10);iImp<numberImproving;iImp++) {
    432432        int * blocks = improvingBlocks[iImp];
    433433        int nBlocks = blocks[0];
     
    746746    }
    747747    CoinSort_2(blockSort,blockSort+numberBlocks_,whichBlock);
     748    // allow user to modify
    748749    intArray_=whichBlock;
    749750    doubleArray_=blockSort;
     
    756757      for (int i=0;i<numberBlocks_;i++) {
    757758        int iBlock = whichBlock[i];
    758         if (iBlock<0||(doneBlock[iBlock]&&!phase_)||!blockSort[i]) {
     759        bool skipBlock=false;
     760        assert (iBlock>=0);
     761        if ((doneBlock[iBlock]&&!phase_)||!blockSort[i]) {
    759762          //printf("already done block %d - dj %g\n",iBlock,blockDj[i]);
     763          skipBlock=true;
     764        } else if (bigDjBlock[iBlock]) {
     765          nBigDjBlock++;
     766          if (nBigDjBlock>20&&!phase_) {
     767            skipBlock=true;
     768          }
     769        }
     770        int returnCode = (*(functionPointer_))(this,NULL,5);
     771        if (returnCode<0)
     772          skipBlock=true;
     773        else if (returnCode>0)
     774          skipBlock=false;
     775        if (skipBlock) {
    760776          whichBlock[i] -= 1000000;
    761777        } else {
    762           if (bigDjBlock[iBlock]) {
    763             nBigDjBlock++;
    764             if (nBigDjBlock>20&&!phase_) {
    765               whichBlock[i] -= 1000000;
    766               continue;
    767             }
    768           }
    769778          // free up
    770779          printf("freeing block %d (already freed %d times) - dj %g, diff %g, diffint %g - %d columns (%d integer)\n",
  • trunk/Cbc/src/CbcHeuristicDW.hpp

    r1946 r1948  
    182182        3 - after DW has been updated
    183183        4 - if better solution found
     184        5 - every time a block might be used
    184185        Pointers to local data given by following pointers
    185186    */
Note: See TracChangeset for help on using the changeset viewer.