00001 // Copyright (C) 2004, International Business Machines 00002 // Corporation and others. All Rights Reserved. 00003 #ifndef CbcTree_H 00004 #define CbcTree_H 00005 using namespace std; 00006 00007 00008 #include <vector> 00009 00016 class CbcTree { 00017 00018 public: 00019 00020 // Default Constructor 00021 CbcTree (); 00022 00023 // Copy constructor 00024 CbcTree ( const CbcTree & rhs); 00025 // = operator 00026 CbcTree & operator=(const CbcTree & rhs); 00027 00028 virtual ~CbcTree(); 00029 00031 virtual CbcTree * clone() const; 00032 00035 00037 void setComparison(CbcCompareBase &compare); 00038 00040 virtual CbcNode * top(); 00041 00043 virtual void push(CbcNode * x); 00044 00046 virtual void pop() ; 00048 virtual CbcNode * bestNode(double cutoff); 00049 00051 00053 00055 virtual bool empty() ; 00056 00058 inline int size() const 00059 { return nodes_.size();} 00060 00062 inline CbcNode * operator [] (int i) const 00063 { return nodes_[i];} 00064 00066 inline CbcNode * nodePointer (int i) const 00067 { return nodes_[i];} 00068 00070 00073 00082 void cleanTree(CbcModel * model, double cutoff, double & bestPossibleObjective); 00083 00085 CbcNode * bestAlternate(); 00086 00088 virtual void endSearch() {} 00090 protected: 00091 std::vector <CbcNode *> nodes_; 00092 CbcCompare comparison_; 00093 00094 00095 }; 00096 #endif 00097