30 #ifndef ROOT_TMVA_BinaryTree
31 #define ROOT_TMVA_BinaryTree
33 #ifndef ROOT_TMVA_Version
50 #ifndef ROOT_TMVA_Node
65 std::ostream&
operator<< ( std::ostream& os,
const BinaryTree& tree );
66 std::istream&
operator>> ( std::istream& istr, BinaryTree& tree );
83 virtual const char*
ClassName()
const = 0;
107 virtual void Print( std::ostream& os )
const;
109 virtual void*
AddXMLTo(
void* parent)
const;
#define TMVA_VERSION_CODE
virtual const char * ClassName() const =0
virtual void Read(std::istream &istr, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
Read the binary tree from an input stream.
UInt_t GetTotalTreeDepth() const
virtual ~BinaryTree()
destructor (deletes the nodes and "events" if owned by the tree
void DeleteNode(Node *)
protected, recursive, function used by the class destructor and when Pruning
virtual BinaryTree * CreateTree() const =0
#define ClassDef(name, id)
void SetTotalTreeDepth(Int_t depth)
friend std::istream & operator>>(std::istream &istr, BinaryTree &tree)
virtual Node * GetRoot() const
virtual void ReadXML(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
read attributes from XML
virtual void Print(std::ostream &os) const
recursively print the tree
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
print the tree recursinvely using the << operator
std::istream & operator>>(std::istream &istr, BinaryTree &tree)
read the tree from an std::istream
virtual Node * CreateNode(UInt_t size=0) const =0
virtual void * AddXMLTo(void *parent) const
add attributes to XML
friend std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
UInt_t CountNodes(Node *n=NULL)
return the number of nodes in the tree. (make a new count –> takes time)
Abstract ClassifierFactory template that handles arbitrary types.
Node * GetRightDaughter(Node *n)
get right daughter node current node "n"
Node * GetLeftDaughter(Node *n)
get left daughter node current node "n"