30#ifndef ROOT_TMVA_BinaryTree
31#define ROOT_TMVA_BinaryTree
101 virtual void Print( std::ostream& os )
const;
103 virtual void*
AddXMLTo(
void* parent)
const;
#define ClassDef(name, id)
#define TMVA_VERSION_CODE
Base class for BinarySearch and Decision Trees.
Node * GetLeftDaughter(Node *n)
get left daughter node current node "n"
Node * GetRightDaughter(Node *n)
get right daughter node current node "n"
virtual void * AddXMLTo(void *parent) const
add attributes to XML
virtual void ReadXML(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
read attributes from XML
BinaryTree(void)
constructor for a yet "empty" tree. Needs to be filled afterwards
void DeleteNode(Node *)
protected, recursive, function used by the class destructor and when Pruning
virtual BinaryTree * CreateTree() 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 CountNodes(Node *n=NULL)
return the number of nodes in the tree. (make a new count --> takes time)
virtual Node * CreateNode(UInt_t size=0) const =0
virtual const char * ClassName() const =0
UInt_t GetTotalTreeDepth() const
void SetTotalTreeDepth(Int_t depth)
virtual Node * GetRoot() const
friend std::istream & operator>>(std::istream &istr, BinaryTree &tree)
friend std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
virtual void Print(std::ostream &os) const
recursively print the tree
virtual ~BinaryTree()
destructor (deletes the nodes and "events" if owned by the tree
ostringstream derivative to redirect and format output
Node for the BinarySearch or Decision Trees.
create variable transformations
std::istream & operator>>(std::istream &istr, BinaryTree &tree)
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)