Changeset 66


Ignore:
Timestamp:
Feb 24, 2005 12:06:53 PM (16 years ago)
Author:
forrest
Message:

few additional methods

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/CbcCutGenerator.cpp

    r25 r66  
    1414#include "CbcCutGenerator.hpp"
    1515#include "CglProbing.hpp"
     16#include "CoinTime.hpp"
    1617
    1718// Default Constructor
     
    2728    atSolution_(false),
    2829    whenInfeasible_(false),
     30    timing_(false),
     31    timeInCutGenerator_(0.0),
    2932    numberTimes_(0),
    3033    numberCuts_(0),
     
    4144    depthCutGenerator_(whatDepth),
    4245    depthCutGeneratorInSub_(whatDepthInSub),
     46    timing_(false),
     47    timeInCutGenerator_(0.0),
    4348    numberTimes_(0),
    4449    numberCuts_(0),
     
    7378  atSolution_=rhs.atSolution_;
    7479  whenInfeasible_=rhs.whenInfeasible_;
     80  timing_ = rhs.timing_;
     81  timeInCutGenerator_ = rhs.timeInCutGenerator_;
    7582  numberTimes_ = rhs.numberTimes_;
    7683  numberCuts_ = rhs.numberCuts_;
     
    96103    atSolution_=rhs.atSolution_;
    97104    whenInfeasible_=rhs.whenInfeasible_;
     105    timing_ = rhs.timing_;
     106    timeInCutGenerator_ = rhs.timeInCutGenerator_;
    98107    numberTimes_ = rhs.numberTimes_;
    99108    numberCuts_ = rhs.numberCuts_;
     
    151160    doThis=false;
    152161  if (fullScan||doThis) {
     162    double time1=0.0;
     163    if (timing_)
     164      time1 = CoinCpuTime();
    153165    CglTreeInfo info;
    154166    info.level = depth;
     
    189201      }
    190202    }
     203    if (timing_)
     204      timeInCutGenerator_ += CoinCpuTime()-time1;
    191205  }
    192206  return returnCode;
  • trunk/CbcModel.cpp

    r56 r66  
    493493  CbcCompareDefault compareDefault(dblParam_[CbcInfeasibilityWeight]) ;
    494494  if (!nodeCompare_)
    495     tree_->setComparison(compareDepth) ;
     495    tree_->setComparison(compareDefault) ;
    496496  else
    497497    tree_->setComparison(*nodeCompare_) ;
  • trunk/include/CbcCutGenerator.hpp

    r13 r66  
    168168  inline void setWhenInfeasible(bool value)
    169169  { whenInfeasible_=value;};
     170  /// Get whether the cut generator is being timed
     171  inline bool timing() const
     172  { return timing_;};
     173  /// Set whether the cut generator is being timed
     174  inline void setTiming(bool value)
     175  { timing_=value; timeInCutGenerator_=0.0;};
     176  /// Return time taken in cut generator
     177  inline double timeInCutGenerator() const
     178  { return timeInCutGenerator_;};
    170179  /// Get the \c CglCutGenerator corresponding to this \c CbcCutGenerator.
    171180  inline CglCutGenerator * generator() const
     
    232241  /// Whether to call generator when a subproblem is found to be infeasible
    233242  bool whenInfeasible_;
     243  /// Whether call generator being timed
     244  bool timing_;
     245  /// Time in cut generator
     246  double timeInCutGenerator_;
    234247 
    235248  /// Number times cut generator entered
  • trunk/include/CbcModel.hpp

    r56 r66  
    403403  inline int getMaximumSolutions() const {
    404404    return getIntParam(CbcMaxNumSol);
     405  }
     406
     407  /** Set the
     408      \link CbcModel::CbcMaximumSeconds maximum number of seconds \endlink
     409      desired.
     410  */
     411  inline bool setMaximumSeconds( double value) {
     412    return setDblParam(CbcMaximumSeconds,value);
     413  }
     414  /** Get the
     415      \link CbcModel::CbcMaximumSeconds maximum number of seconds \endlink
     416      desired.
     417  */
     418  inline double getMaximumSeconds() const {
     419    return getDblParam(CbcMaximumSeconds);
    405420  }
    406421
     
    10571072  /// Set language
    10581073  void newLanguage(CoinMessages::Language language);
    1059   void setLanguage(CoinMessages::Language language)
     1074  inline void setLanguage(CoinMessages::Language language)
    10601075  {newLanguage(language);};
    10611076  /// Return handler
    1062   CoinMessageHandler * messageHandler() const
     1077  inline CoinMessageHandler * messageHandler() const
    10631078  {return handler_;};
    10641079  /// Return messages
    1065   CoinMessages messages()
     1080  inline CoinMessages messages()
    10661081  {return messages_;};
    10671082  /// Return pointer to messages
    1068   CoinMessages * messagesPointer()
     1083  inline CoinMessages * messagesPointer()
    10691084  {return &messages_;};
     1085  /// Set log level
     1086  inline void setLogLevel(int value)
     1087  { handler_->setLogLevel(value);};
     1088  /// Get log level
     1089  inline int logLevel() const
     1090  { return handler_->logLevel();};
    10701091  //@}
    10711092  //---------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.