Changeset 2074 for trunk/Cbc/src


Ignore:
Timestamp:
Sep 14, 2014 1:33:13 PM (5 years ago)
Author:
forrest
Message:

make zerohalf work with threads

Location:
trunk/Cbc/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcCutGenerator.hpp

    r1880 r2074  
    347347        switches_ &= ~4096;
    348348        switches_ |= yesNo ? 4096 : 0;
     349    }
     350    /// Whether needs refresh on copy
     351    inline bool needsRefresh() const {
     352        return (switches_&8192) != 0;
     353    }
     354    /// Set whether needs refresh on copy
     355    inline void setNeedsRefresh(bool yesNo) {
     356        switches_ &= ~8192;
     357        switches_ |= yesNo ? 8192 : 0;
    349358    }
    350359    /// Number of cuts generated at root
  • trunk/Cbc/src/CbcSolver.cpp

    r2070 r2074  
    50435043                                babModel_->addCutGenerator(&zerohalfGen, translate[zerohalfAction], "ZeroHalf");
    50445044                                accuracyFlag[numberGenerators] = 5;
     5045                                babModel_->cutGenerator(numberGenerators)->
     5046                                  setNeedsRefresh(true);
    50455047                                switches[numberGenerators++] = 2;
    50465048                            }
  • trunk/Cbc/src/CbcThread.cpp

    r1971 r2074  
    15971597            generator_[i] = new CbcCutGenerator(*baseModel->generator_[i]);
    15981598            // refreshModel was overkill as thought too many rows
    1599             generator_[i]->setModel(this);
     1599            if (generator_[i]->needsRefresh())
     1600              generator_[i]->refreshModel(this);
     1601            else
     1602              generator_[i]->setModel(this);
    16001603        }
    16011604    } else if (mode == 10) {
Note: See TracChangeset for help on using the changeset viewer.