30 #ifndef ROOT_TMVA_BinaryTree
31 #define ROOT_TMVA_BinaryTree
59 std::ostream& operator<< ( std::ostream& os,
const BinaryTree& tree );
60 std::istream& operator>> ( std::istream& istr, BinaryTree& tree );
64 friend std::ostream& operator<< ( std::ostream& os,
const BinaryTree& tree );
65 friend std::istream& operator>> ( std::istream& istr, BinaryTree& tree );
72 virtual ~BinaryTree();
74 virtual Node* CreateNode(UInt_t size=0)
const = 0;
75 virtual BinaryTree* CreateTree()
const = 0;
77 virtual const char* ClassName()
const = 0;
80 void SetRoot( Node* r ) { fRoot = r; }
83 virtual Node* GetRoot()
const {
return fRoot; }
86 UInt_t GetNNodes()
const {
return fNNodes; }
91 UInt_t CountNodes( Node* n = NULL );
93 UInt_t GetTotalTreeDepth()
const {
return fDepth; }
95 void SetTotalTreeDepth( Int_t depth ) { fDepth = depth; }
96 void SetTotalTreeDepth( Node* n = NULL );
98 Node* GetLeftDaughter ( Node* n);
99 Node* GetRightDaughter( Node* n);
101 virtual void Print( std::ostream& os )
const;
102 virtual void Read ( std::istream& istr, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
103 virtual void* AddXMLTo(
void* parent)
const;
104 virtual void ReadXML(
void* node, UInt_t tmva_Version_Code = TMVA_VERSION_CODE );
115 void DeleteNode( Node* );
120 MsgLogger& Log()
const;
122 ClassDef(BinaryTree,0);