Changeset 701


Ignore:
Timestamp:
Dec 9, 2005 6:05:07 PM (14 years ago)
Author:
forrest
Message:

messages and preprocessing

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ClpModel.cpp

    r676 r701  
    3333#endif
    3434#include "ClpMessage.hpp"
     35#include "CoinMessage.hpp"
    3536#include "ClpLinearObjective.hpp"
    3637#ifndef SLIM_CLP
     
    100101  eventHandler_ = new ClpEventHandler();
    101102  messages_ = ClpMessage();
     103  coinMessages_ = CoinMessage();
    102104  CoinSeedRandom(1234567);
    103105}
     
    638640  eventHandler_ = rhs.eventHandler_->clone();
    639641  messages_ = rhs.messages_;
     642  coinMessages_ = rhs.coinMessages_;
    640643  intParam_[ClpMaxNumIteration] = rhs.intParam_[ClpMaxNumIteration];
    641644  intParam_[ClpMaxNumIterationHotStart] =
     
    23212324  CoinMpsIO m;
    23222325  m.passInMessageHandler(handler_);
     2326  *m.messagesPointer()=coinMessages();
    23232327  bool savePrefix =m.messageHandler()->prefix();
    23242328  m.messageHandler()->setPrefix(handler_->prefix());
     
    24252429  CoinMpsIO m;
    24262430  m.passInMessageHandler(handler_);
     2431  *m.messagesPointer()=coinMessages();
    24272432  bool savePrefix =m.messageHandler()->prefix();
    24282433  m.messageHandler()->setPrefix(handler_->prefix());
     
    27192724  eventHandler_ = rhs->eventHandler_->clone();
    27202725  messages_ = rhs->messages_;
     2726  coinMessages_ = rhs->coinMessages_;
    27212727  intParam_[ClpMaxNumIteration] = rhs->intParam_[ClpMaxNumIteration];
    27222728  intParam_[ClpMaxNumIterationHotStart] =
     
    32033209  CoinMpsIO writer;
    32043210  writer.passInMessageHandler(handler_);
     3211  *writer.messagesPointer()=coinMessages();
    32053212  writer.setMpsData(*(matrix_->getPackedMatrix()), COIN_DBL_MAX,
    32063213                    getColLower(), getColUpper(),
  • trunk/ClpPresolve.cpp

    r685 r701  
    149149    return;
    150150  // Messages
    151   CoinMessages messages = CoinMessage(presolvedModel_->messages().language());
     151  CoinMessages messages = originalModel_->coinMessages();
    152152  if (!presolvedModel_->isProvenOptimal()) {
    153153    presolvedModel_->messageHandler()->message(COIN_PRESOLVE_NONOPTIMAL,
     
    14311431  presolvedModel_=NULL;
    14321432  // Messages
    1433   CoinMessages messages = CoinMessage(originalModel->messages().language());
     1433  CoinMessages messages = originalModel->coinMessages();
    14341434  while (result==-1) {
    14351435
  • trunk/ClpSimplex.cpp

    r700 r701  
    33733373        auxiliaryModel_->matrix_=temp;
    33743374      }
     3375      for (iRow=0;iRow<4;iRow++) {
     3376        rowArray_[iRow]->clear();
    33753377#ifndef NDEBUG
    3376       for (iRow=0;iRow<4;iRow++) {
    33773378        int length =numberRows2+factorization_->maximumPivots();
    33783379        if (iRow==3||objective_->type()>1)
     
    33803381        assert(rowArray_[iRow]->capacity()==length);
    33813382        rowArray_[iRow]->checkClear();
     3383#endif
    33823384      }
    33833385     
    33843386      for (iColumn=0;iColumn<2;iColumn++) {
     3387        columnArray_[iColumn]->clear();
     3388#ifndef NDEBUG
    33853389        int length =numberColumns_;
    33863390        if (iColumn)
     
    33883392        assert(columnArray_[iColumn]->capacity()==length);
    33893393        columnArray_[iColumn]->checkClear();
    3390       }
    33913394#endif
     3395      }
    33923396    }   
    33933397  }
     
    85568560  //}
    85578561}
     8562// If user left factorization frequency then compute
     8563void
     8564ClpSimplex::defaultFactorizationFrequency()
     8565{
     8566  if (factorizationFrequency()==200) {
     8567    // User did not touch preset
     8568    const int cutoff1=10000;
     8569    const int cutoff2=100000;
     8570    const int base=75;
     8571    const int freq0 = 50;
     8572    const int freq1=200;
     8573    const int freq2=400;
     8574    const int maximum=1000;
     8575    int frequency;
     8576    if (numberRows_<cutoff1)
     8577      frequency=base+numberRows_/freq0;
     8578    else if (numberRows_<cutoff2)
     8579      frequency=base+cutoff1/freq0 + (numberRows_-cutoff1)/freq1;
     8580    else
     8581      frequency=base+cutoff1/freq0 + (cutoff2-cutoff1)/freq1 + (numberRows_-cutoff2)/freq2;
     8582    setFactorizationFrequency(CoinMin(maximum,frequency));
     8583  }
     8584}
  • trunk/ClpSimplexDual.cpp

    r685 r701  
    48354835  // or we can just increment iBasic one by one
    48364836  // for now let ...iBasic give pivot row
    4837   int useFactorization=false;
    4838   if ((startFinishOptions&2)!=0&&(whatsChanged_&(2+512))==2+512)
     4837  bool useFactorization=false;
     4838  if ((startFinishOptions&2)!=0&&(whatsChanged_&(2+512))==2+512) {
    48394839    useFactorization=true; // Keep factorization if possible
    4840   // switch off factorization if bad
    4841   if (pivotVariable_[0]<0)
    4842     useFactorization=false;
    4843   if (!useFactorization||factorization_->numberRows()!=numberRows_) {
    4844     useFactorization = false;
     4840    // switch off factorization if bad
     4841    if (pivotVariable_[0]<0||factorization_->numberRows()!=numberRows_)
     4842      useFactorization=false;
     4843  }
     4844  if (!useFactorization) {
    48454845    factorization_->increasingRows(2);
    48464846    // row activities have negative sign
  • trunk/ClpSimplexOther.cpp

    r689 r701  
    580580  CoinMpsIO m;
    581581  m.passInMessageHandler(handler_);
     582  *m.messagesPointer()=coinMessages();
    582583  bool savePrefix =m.messageHandler()->prefix();
    583584  m.messageHandler()->setPrefix(handler_->prefix());
  • trunk/ClpSolve.cpp

    r699 r701  
    654654  if (this->factorizationFrequency()==200) {
    655655    // User did not touch preset
    656     int numberRows = model2->numberRows();
    657     const int cutoff1=10000;
    658     const int cutoff2=100000;
    659     const int base=75;
    660     const int freq0 = 50;
    661     const int freq1=200;
    662     const int freq2=400;
    663     const int maximum=2000;
    664     int frequency;
    665     if (numberRows<cutoff1)
    666       frequency=base+numberRows/freq0;
    667     else if (numberRows<cutoff2)
    668       frequency=base+cutoff1/freq0 + (numberRows-cutoff1)/freq1;
    669     else
    670       frequency=base+cutoff1/freq0 + (cutoff2-cutoff1)/freq1 + (numberRows-cutoff2)/freq2;
    671     model2->setFactorizationFrequency(CoinMin(maximum,frequency));
     656    model2->defaultFactorizationFrequency();
    672657  } else if (model2!=this) {
    673658    // make sure model2 has correct value
  • trunk/include/ClpModel.hpp

    r692 r701  
    629629   /// Return pointer to messages
    630630   inline CoinMessages * messagesPointer()                  { return & messages_; }
     631   /// Return Coin messages
     632   inline CoinMessages coinMessages() const                  { return coinMessages_; }
     633   /// Return pointer to Coin messages
     634   inline CoinMessages * coinMessagesPointer()                  { return & coinMessages_; }
    631635  /** Amount of print out:
    632636      0 - none
     
    887891  /// Messages
    888892  CoinMessages messages_;
     893  /// Coin messages
     894  CoinMessages coinMessages_;
    889895#ifndef CLP_NO_STD
    890896  /// Array of string parameters
  • trunk/include/ClpSimplex.hpp

    r694 r701  
    395395  /** Factorizes and returns true if optimal.  Used by user */
    396396  bool statusOfProblem(bool initial=false);
     397  /// If user left factorization frequency then compute
     398  void defaultFactorizationFrequency();
    397399  //@}
    398400
Note: See TracChangeset for help on using the changeset viewer.