30 #ifndef ROOT_TMVA_BinaryTree 31 #define ROOT_TMVA_BinaryTree 59 std::ostream&
operator<< ( std::ostream& os,
const BinaryTree&
tree );
77 virtual const char*
ClassName()
const = 0;
101 virtual void Print( std::ostream& os )
const;
103 virtual void*
AddXMLTo(
void* parent)
const;
virtual void * AddXMLTo(void *parent) const
add attributes to XML
#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.
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
Base class for BinarySearch and Decision Trees.
#define ClassDef(name, id)
void SetTotalTreeDepth(Int_t depth)
virtual void Print(std::ostream &os) const
recursively print the tree
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
friend std::istream & operator>>(std::istream &istr, BinaryTree &tree)
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
UInt_t GetTotalTreeDepth() const
virtual Node * CreateNode(UInt_t size=0) const =0
ostringstream derivative to redirect and format output
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 for the BinarySearch or Decision Trees.
std::istream & operator>>(std::istream &istr, BinaryTree &tree)
Node * GetLeftDaughter(Node *n)
get left daughter node current node "n"
virtual Node * GetRoot() const