Ignore:
Timestamp:
Jun 26, 2007 5:59:58 AM (12 years ago)
Author:
forrest
Message:

update branches/devel for threads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/devel/Cbc/src/CbcModel.hpp

    r607 r642  
    262262  /// Update size of whichGenerator
    263263  void resizeWhichGenerator(int numberNow, int numberAfter);
     264public:
     265  /** Do one node - broken out for clarity?
     266      also for parallel (when baseModel!=this)
     267      Returns 1 if solution found
     268      node NULL on return if no branches left
     269      newNode NULL if no new node created
     270  */
     271  int doOneNode(CbcModel * baseModel, CbcNode * & node, CbcNode * & newNode);
     272
     273  /// Returns true if locked
     274  bool isLocked() const;
     275#ifdef CBC_THREAD
     276  /**
     277     Locks a thread if parallel so that stuff like cut pool
     278     can be updated and/or used.
     279  */
     280  void lockThread();
     281  /**
     282     Unlocks a thread if parallel to say cut pool stuff not needed
     283  */
     284  void unlockThread();
     285#else
     286  inline void lockThread() {};
     287  inline void unlockThread() {};
     288#endif
     289private:
     290  /** Move/copy information from one model to another
     291      -1 - initialization
     292      0 - from base model
     293      1 - to base model (and reset)
     294      2 - add in final statistics etc (and reset so can do clean destruction)
     295  */
     296  void moveToModel(CbcModel * baseModel,int mode);
    264297public:
    265298    /** \brief Reoptimise an LP relaxation
     
    10401073  inline double * bestSolution() const
    10411074  { return bestSolution_;};
     1075  void setBestSolution(const double * solution,int numberColumns,double objectiveValue);
    10421076 
    10431077  /// Get number of solutions
     
    10931127  inline void setResolveAfterTakeOffCuts(bool yesNo)
    10941128  { resolveAfterTakeOffCuts_=yesNo;};
     1129  /// Get number of threads
     1130  inline int getNumberThreads() const
     1131  { return numberThreads_;};
     1132  /// Set number of threads
     1133  inline void setNumberThreads(int value)
     1134  { numberThreads_=value;};
     1135  /// Get thread mode
     1136  inline int getThreadMode() const
     1137  { return threadMode_;};
     1138  /** Set thread mode
     1139      always use numberThreads for branching
     1140      1 set then use numberThreads in root mini branch and bound
     1141      2 set then use numberThreads for root cuts
     1142      default is 0
     1143  */
     1144  inline void setThreadMode(int value)
     1145  { threadMode_=value;};
    10951146  //@}
    10961147
     
    11441195  inline void setTypePresolve(int value)
    11451196  { presolve_=value;};
     1197 
    11461198  //@}
    11471199
     
    13801432  inline bool ownObjects() const
    13811433  { return ownObjects_;};
     1434  /// Pointer to a mutex
     1435  inline void * mutex()
     1436  { return mutex_;};
    13821437  //@}
    13831438  //---------------------------------------------------------------------------
     
    18101865  /// Pointer to user-defined data structure
    18111866  void * appData_;
    1812   /// Pointer to
     1867  /// Pointer to a mutex
     1868  void * mutex_;
     1869  /// Presolve for CbcTreeLocal
    18131870  int presolve_;
    18141871  /** Maximum number of candidates to consider for strong branching.
     
    19492006  /// Whether to force a resolve after takeOffCuts
    19502007  bool resolveAfterTakeOffCuts_;
     2008  /**
     2009     Parallel
     2010     0 - off
     2011     1 - testing
     2012     2-99 threads
     2013     other special meanings
     2014  */
     2015  int numberThreads_;
     2016  /** thread mode
     2017      always use numberThreads for branching
     2018      1 set then use numberThreads in root mini branch and bound
     2019      2 set then use numberThreads for root cuts
     2020      default is 0
     2021  */
     2022  int threadMode_;
    19512023 //@}
    19522024};
Note: See TracChangeset for help on using the changeset viewer.