107 if (n == NULL)
return 0 ;
128 os <<
"-1" << std::endl;
191 if (currentNode->
GetPos()==
'l') parent->
SetLeft(currentNode);
195 parent = currentNode;
218 Log() << kFATAL <<
"SetTotalTreeDepth: started with undefined ROOT node" <<
Endl;
236 TTHREAD_TLS_DECL_ARG(
MsgLogger,logger,
"BinaryTree");
virtual void * AddXMLTo(void *parent) const
add attributes to XML
virtual void PrintRec(std::ostream &os) const =0
void * AddXMLTo(void *parent) const
add attributes to XML
virtual const char * ClassName() const =0
MsgLogger & Endl(MsgLogger &ml)
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
virtual void SetRight(Node *r)
void DeleteNode(Node *)
protected, recursive, function used by the class destructor and when Pruning
virtual Bool_t ReadDataRecord(std::istream &, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)=0
virtual void SetLeft(Node *l)
Base class for BinarySearch and Decision Trees.
virtual Node * GetRight() const
virtual Node * GetLeft() const
void SetTotalTreeDepth(Int_t depth)
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
virtual Node * GetParent() const
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
virtual void ReadXML(void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
read attributes from XML
virtual void SetParent(Node *p)
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
UInt_t CountNodes(Node *n=NULL)
return the number of nodes in the tree. (make a new count –> takes time)
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