Ignore:
Timestamp:
Sep 22, 2014 1:15:59 PM (5 years ago)
Author:
forrest
Message:

make message handlers threadsafer (also modify multiple root solver)

File:
1 edited

Legend:

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

    r2073 r2078  
    25932593        OsiClpSolverInterface * clpSolver
    25942594          = dynamic_cast<OsiClpSolverInterface *> (rootModels[i]->solver_);
     2595#define NEW_RANDOM_BASIS
     2596#ifdef NEW_RANDOM_BASIS
     2597        if (i==0)
     2598          continue;
     2599#endif
    25952600        if (clpSolver) {
    25962601          ClpSimplex * simplex = clpSolver->getModelPtr();
     
    26032608            simplex->setLogLevel(0);
    26042609          if (i!=0) {
     2610#ifdef NEW_RANDOM_BASIS
     2611            int numberRows = simplex->numberRows();
     2612            int throwOut=20;//2+numberRows/100;
     2613            for (int iThrow=0;iThrow<throwOut;iThrow++) {
     2614              double random = simplex->randomNumberGenerator()->randomDouble();
     2615              int iStart=static_cast<int>(random*numberRows);
     2616              for (int j=iStart;j<numberRows;j++) {
     2617                if (simplex->getRowStatus(j)!=ClpSimplex::basic) {
     2618                  simplex->setRowStatus(j,ClpSimplex::basic);
     2619                  break;
     2620                }
     2621              }
     2622            }
     2623            clpSolver->setWarmStart(NULL);
     2624#else
    26052625            double random = simplex->randomNumberGenerator()->randomDouble();
    26062626            int bias = static_cast<int>(random*(numberIterations/4));
     
    26092629            simplex->setMaximumIterations(COIN_INT_MAX);
    26102630            simplex->dual();
     2631#endif
    26112632          } else {
     2633#ifndef NEW_RANDOM_BASIS
    26122634            simplex->primal();
    26132635            numberIterations=simplex->numberIterations();
     2636#endif
    26142637          }
     2638#ifdef NEW_RANDOM_BASIS
    26152639          simplex->setLogLevel(logLevel);
    26162640          clpSolver->setWarmStart(NULL);
     2641#endif
    26172642        }
    26182643#endif
     
    58845909        object_ = NULL;
    58855910    }
     5911    if (rhs.continuousSolver_) {
     5912        continuousSolver_ = rhs.continuousSolver_->clone() ;
     5913    } else {
     5914        continuousSolver_ = NULL ;
     5915    }
    58865916    if (rhs.referenceSolver_)
    58875917        referenceSolver_ = rhs.referenceSolver_->clone();
Note: See TracChangeset for help on using the changeset viewer.