Changeset 1287 for trunk/Clp


Ignore:
Timestamp:
Oct 8, 2008 4:22:42 AM (11 years ago)
Author:
forrest
Message:

changes for cbc event handler and multiple factorizations

Location:
trunk/Clp/src
Files:
10 edited

Legend:

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

    r1262 r1287  
    486486    up_count_in+= spare->getNumElements();
    487487#endif
    488     if (permute) {
     488    if (permute||true) {
    489489#if CLP_DEBUG>2
    490490      printf("REGION before %d els\n",spare->getNumElements());
     
    492492#endif
    493493      model_->factorization()->updateTwoColumnsFT(spare2,updatedColumn,
    494                                                   spare,true);
     494                                                  spare,permute!=NULL);
    495495#if CLP_DEBUG>2
    496496      printf("REGION after %d els\n",spare->getNumElements());
  • trunk/Clp/src/ClpEventHandler.cpp

    r1034 r1287  
    112112  model_= model;
    113113}
     114// Type of disaster 0 can fix, 1 abort
     115int
     116ClpDisasterHandler::typeOfDisaster()
     117{
     118  return 0;
     119}
    114120
    115121
  • trunk/Clp/src/ClpEventHandler.hpp

    r1055 r1287  
    105105  /// saves information for next attempt
    106106  virtual void saveInfo() =0;
     107  /// Type of disaster 0 can fix, 1 abort
     108  virtual int typeOfDisaster();
    107109  //@}
    108110 
  • trunk/Clp/src/ClpFactorization.cpp

    r1286 r1287  
    7777// Copy constructor
    7878//-------------------------------------------------------------------
    79 ClpFactorization::ClpFactorization (const ClpFactorization & rhs) :
     79ClpFactorization::ClpFactorization (const ClpFactorization & rhs,
     80                                    int dummyDenseIfSmaller) :
    8081   CoinFactorization(rhs)
    8182{
     
    11411142    else if (denseIfSmaller<=goSmallThreshold_)
    11421143      goDense=2;
     1144  } else if (denseIfSmaller<0) {
     1145    if (-denseIfSmaller<=goDenseThreshold_)
     1146      goDense=1;
     1147    else if (-denseIfSmaller<=goSmallThreshold_)
     1148      goDense=2;
    11431149  }
    11441150  if (rhs.coinFactorizationA_&&!goDense)
     
    11461152  else
    11471153    coinFactorizationA_=NULL;
    1148   if (rhs.coinFactorizationB_)
     1154  if (rhs.coinFactorizationB_&&(denseIfSmaller>=0||!goDense))
    11491155    coinFactorizationB_ = rhs.coinFactorizationB_->clone();
    1150   //coinFactorizationB_ = new CoinSmallFactorization(*(rhs.coinFactorizationB_));
    11511156  else
    11521157    coinFactorizationB_=NULL;
     
    11571162    else
    11581163      coinFactorizationB_ = new CoinSimpFactorization();
    1159     assert(rhs.coinFactorizationA_);
    1160     coinFactorizationB_->maximumPivots(rhs.coinFactorizationA_->maximumPivots());
    1161     coinFactorizationB_->pivotTolerance(rhs.coinFactorizationA_->pivotTolerance());
    1162     coinFactorizationB_->zeroTolerance(rhs.coinFactorizationA_->zeroTolerance());
     1164    if (rhs.coinFactorizationA_) {
     1165      coinFactorizationB_->maximumPivots(rhs.coinFactorizationA_->maximumPivots());
     1166      coinFactorizationB_->pivotTolerance(rhs.coinFactorizationA_->pivotTolerance());
     1167      coinFactorizationB_->zeroTolerance(rhs.coinFactorizationA_->zeroTolerance());
     1168    } else {
     1169      assert (coinFactorizationB_);
     1170      coinFactorizationB_->maximumPivots(rhs.coinFactorizationB_->maximumPivots());
     1171      coinFactorizationB_->pivotTolerance(rhs.coinFactorizationB_->pivotTolerance());
     1172      coinFactorizationB_->zeroTolerance(rhs.coinFactorizationB_->zeroTolerance());
     1173    }
    11631174  }
    11641175  assert (!coinFactorizationA_||!coinFactorizationB_);
     
    23632374      coinFactorizationA_->setCollectStatistics(false);
    23642375    } else {
    2365       returnCode= coinFactorizationB_->updateColumnFT(regionSparse1,
    2366                                                      regionSparse2);
    2367       coinFactorizationB_->updateColumn(regionSparse1,
    2368                                         regionSparse3,
    2369                                         noPermuteRegion3);
     2376#if 0
     2377      CoinSimpFactorization * fact =
     2378        dynamic_cast< CoinSimpFactorization*>(coinFactorizationB_);
     2379      if (!fact) {
     2380        returnCode= coinFactorizationB_->updateColumnFT(regionSparse1,
     2381                                                        regionSparse2);
     2382        coinFactorizationB_->updateColumn(regionSparse1,
     2383                                          regionSparse3,
     2384                                          noPermuteRegion3);
     2385      } else {
     2386        returnCode= fact->updateTwoColumnsFT(regionSparse1,
     2387                                             regionSparse2,
     2388                                             regionSparse3,
     2389                                             noPermuteRegion3);
     2390      }
     2391#else
     2392      returnCode= coinFactorizationB_->updateTwoColumnsFT(regionSparse1,
     2393                                                          regionSparse2,
     2394                                                          regionSparse3,
     2395                                                          noPermuteRegion3);
     2396#endif
    23702397    }
    23712398#ifdef CLP_FACTORIZATION_INSTRUMENT
  • trunk/Clp/src/ClpFactorization.hpp

    r1286 r1287  
    6565   /** The copy constructor from an CoinFactorization. */
    6666   ClpFactorization(const CoinFactorization&);
     67   /** The copy constructor. */
     68  ClpFactorization(const ClpFactorization&,int denseIfSmaller=0);
    6769#ifdef CLP_MULTIPLE_FACTORIZATIONS   
    68    /** The copy constructor. */
    69   ClpFactorization(const ClpFactorization&,int denseIfSmaller=-1);
    7070   /** The copy constructor from an CoinSmallFactorization. */
    7171   ClpFactorization(const CoinSmallFactorization&);
    72 #else
    73    /** The copy constructor. */
    74    ClpFactorization(const ClpFactorization&);
    7572#endif
    7673   ClpFactorization& operator=(const ClpFactorization&);
  • trunk/Clp/src/ClpMain.cpp

    r1286 r1287  
    735735              int denseCode = parameters[whichParam(DENSE,numberParameters,parameters)].intValue();
    736736              model2->factorization()->setGoDenseThreshold(denseCode);
     737              int smallCode = parameters[whichParam(SMALLFACT,numberParameters,parameters)].intValue();
     738              model2->factorization()->setGoSmallThreshold(smallCode);
    737739              model2->factorization()->goDenseOrSmall(model2->numberRows());
    738740#endif
  • trunk/Clp/src/ClpNode.cpp

    r1286 r1287  
    9494    maximumColumns_=CoinMax(maximumColumns_,numberColumns);
    9595    maximumTotal = maximumRows_+maximumColumns_;
    96     factorization_ = new ClpFactorization(*model->factorization());
     96    factorization_ = new ClpFactorization(*model->factorization(),numberRows);
    9797    status_ = CoinCopyOfArrayPartial(model->statusArray(),maximumTotal,numberTotal);
    9898    primalSolution_ = CoinCopyOfArrayPartial(model->solutionRegion(),maximumTotal,numberTotal);
  • trunk/Clp/src/ClpSimplex.cpp

    r1286 r1287  
    401401  }
    402402  saveStatus_=NULL;
    403 #ifdef CLP_MULTIPLE_FACTORIZATIONS   
    404   factorization_ = new ClpFactorization(*rhs->factorization_,numberRows_);
    405 #else
    406   factorization_ = new ClpFactorization(*rhs->factorization_);
    407 #endif
     403  factorization_ = new ClpFactorization(*rhs->factorization_,-numberRows_);
    408404  ClpDualRowDantzig * pivot =
    409405    dynamic_cast< ClpDualRowDantzig*>(rhs->dualRowPivot_);
     
    21932189  if (rhs.factorization_) {
    21942190    delete factorization_;
    2195     factorization_ = new ClpFactorization(*rhs.factorization_);
     2191    factorization_ = new ClpFactorization(*rhs.factorization_,numberRows_);
    21962192  } else {
    21972193    factorization_=NULL;
     
    49224918{
    49234919  delete factorization_;
    4924   factorization_= new ClpFactorization(factorization);
     4920  factorization_= new ClpFactorization(factorization,numberRows_);
    49254921}
    49264922// Copies in factorization to existing one
  • trunk/Clp/src/ClpSimplex.hpp

    r1286 r1287  
    931931      8 bit - if factorization kept can still declare optimal at once
    932932      16 bit - if checking replaceColumn accuracy before updating
     933      32 bit - say optimal if primal feasible!
    933934  */
    934935  inline int moreSpecialOptions() const
  • trunk/Clp/src/ClpSimplexDual.cpp

    r1286 r1287  
    311311      // Can't get here if values pass
    312312      gutsOfSolution(NULL,NULL);
     313      //if (numberDualInfeasibilities_)
     314      //printf("ZZZ %d primal %d dual - cost %g\n",
     315      //       numberPrimalInfeasibilities_,
     316      //       numberDualInfeasibilities_,cost_[0]);
    313317      if (handler_->logLevel()>2) {
    314318        handler_->message(CLP_SIMPLEX_STATUS,messages_)
     
    331335        } else if (numberDualInfeasibilities_) {
    332336          problemStatus_=10;
     337          if ((moreSpecialOptions_&32)!=0&&false)
     338            problemStatus_ = 0; // say optimal!!
    333339#if COIN_DEVELOP>2
    334340         
     
    52025208    CoinMemcpyN(savePivot, numberRows_,pivotVariable_);
    52035209    delete factorization_;
    5204     factorization_ = new ClpFactorization(saveFactorization);
     5210    factorization_ = new ClpFactorization(saveFactorization,numberRows_);
    52055211
    52065212    newUpper[i]=objectiveChange;
     
    52655271    CoinMemcpyN(savePivot, numberRows_,pivotVariable_);
    52665272    delete factorization_;
    5267     factorization_ = new ClpFactorization(saveFactorization);
     5273    factorization_ = new ClpFactorization(saveFactorization,numberRows_);
    52685274
    52695275    newLower[i]=objectiveChange;
     
    56025608          numberRows_+numberColumns_,saveObjective);
    56035609  CoinMemcpyN(pivotVariable_, numberRows_,savePivot);
    5604   return new ClpFactorization(*factorization_);
     5610  return new ClpFactorization(*factorization_,numberRows_);
    56055611}
    56065612// This cleans up after strong branching
Note: See TracChangeset for help on using the changeset viewer.