ROOT  6.06/08
Reference Guide
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
TMVA::BinaryTree Class Referenceabstract

Definition at line 68 of file BinaryTree.h.

Public Member Functions

 BinaryTree (void)
 constructor for a yet "empty" tree. Needs to be filled afterwards More...
 
virtual ~BinaryTree ()
 destructor (deletes the nodes and "events" if owned by the tree More...
 
virtual NodeCreateNode (UInt_t size=0) const =0
 
virtual BinaryTreeCreateTree () const =0
 
virtual const char * ClassName () const =0
 
void SetRoot (Node *r)
 
virtual NodeGetRoot () const
 
UInt_t GetNNodes () const
 
UInt_t CountNodes (Node *n=NULL)
 return the number of nodes in the tree. (make a new count –> takes time) More...
 
UInt_t GetTotalTreeDepth () const
 
void SetTotalTreeDepth (Int_t depth)
 
void SetTotalTreeDepth (Node *n=NULL)
 descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time. More...
 
NodeGetLeftDaughter (Node *n)
 get left daughter node current node "n" More...
 
NodeGetRightDaughter (Node *n)
 get right daughter node current node "n" More...
 
virtual void Print (std::ostream &os) const
 recursively print the tree More...
 
virtual void Read (std::istream &istr, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
 Read the binary tree from an input stream. More...
 
virtual voidAddXMLTo (void *parent) const
 add attributes to XML More...
 
virtual void ReadXML (void *node, UInt_t tmva_Version_Code=TMVA_VERSION_CODE)
 read attributes from XML More...
 

Protected Member Functions

void DeleteNode (Node *)
 protected, recursive, function used by the class destructor and when Pruning More...
 
MsgLoggerLog () const
 

Protected Attributes

NodefRoot
 
UInt_t fNNodes
 
UInt_t fDepth
 

Friends

std::ostream & operator<< (std::ostream &os, const BinaryTree &tree)
 
std::istream & operator>> (std::istream &istr, BinaryTree &tree)
 

#include <TMVA/BinaryTree.h>

+ Inheritance diagram for TMVA::BinaryTree:
+ Collaboration diagram for TMVA::BinaryTree:

Constructor & Destructor Documentation

§ BinaryTree()

TMVA::BinaryTree::BinaryTree ( void  )

constructor for a yet "empty" tree. Needs to be filled afterwards

Definition at line 52 of file BinaryTree.cxx.

§ ~BinaryTree()

TMVA::BinaryTree::~BinaryTree ( void  )
virtual

destructor (deletes the nodes and "events" if owned by the tree

Definition at line 62 of file BinaryTree.cxx.

Member Function Documentation

§ AddXMLTo()

void * TMVA::BinaryTree::AddXMLTo ( void parent) const
virtual

add attributes to XML

Definition at line 131 of file BinaryTree.cxx.

Referenced by TMVA::MethodDT::AddWeightsXMLTo(), TMVA::MethodPDERS::AddWeightsXMLTo(), and SetTotalTreeDepth().

§ ClassName()

virtual const char* TMVA::BinaryTree::ClassName ( ) const
pure virtual

Implemented in TMVA::DecisionTree, and TMVA::BinarySearchTree.

Referenced by AddXMLTo().

§ CountNodes()

UInt_t TMVA::BinaryTree::CountNodes ( TMVA::Node n = NULL)

return the number of nodes in the tree. (make a new count –> takes time)

Definition at line 100 of file BinaryTree.cxx.

Referenced by TMVA::DecisionTree::CleanTree(), GetNNodes(), TMVA::DecisionTree::PruneNode(), TMVA::DecisionTree::PruneTree(), and TMVA::MethodPDERS::ReadWeightsFromXML().

§ CreateNode()

virtual Node* TMVA::BinaryTree::CreateNode ( UInt_t  size = 0) const
pure virtual

Implemented in TMVA::DecisionTree, and TMVA::BinarySearchTree.

Referenced by Read(), and ReadXML().

§ CreateTree()

virtual BinaryTree* TMVA::BinaryTree::CreateTree ( ) const
pure virtual

§ DeleteNode()

void TMVA::BinaryTree::DeleteNode ( TMVA::Node node)
protected

protected, recursive, function used by the class destructor and when Pruning

Definition at line 71 of file BinaryTree.cxx.

Referenced by TMVA::DecisionTree::PruneNode(), ReadXML(), and ~BinaryTree().

§ GetLeftDaughter()

TMVA::Node * TMVA::BinaryTree::GetLeftDaughter ( Node n)

§ GetNNodes()

UInt_t TMVA::BinaryTree::GetNNodes ( ) const
inline

§ GetRightDaughter()

TMVA::Node * TMVA::BinaryTree::GetRightDaughter ( Node n)

§ GetRoot()

virtual Node* TMVA::BinaryTree::GetRoot ( ) const
inlinevirtual

§ GetTotalTreeDepth()

UInt_t TMVA::BinaryTree::GetTotalTreeDepth ( ) const
inline

§ Log()

TMVA::MsgLogger & TMVA::BinaryTree::Log ( ) const
protected

§ Print()

void TMVA::BinaryTree::Print ( std::ostream &  os) const
virtual

recursively print the tree

Definition at line 122 of file BinaryTree.cxx.

Referenced by TMVA::operator<<(), and SetTotalTreeDepth().

§ Read()

void TMVA::BinaryTree::Read ( std::istream &  istr,
UInt_t  tmva_Version_Code = TMVA_VERSION_CODE 
)
virtual

Read the binary tree from an input stream.

The input stream format depends on the tree type, it is defined be the node of the tree

Definition at line 166 of file BinaryTree.cxx.

Referenced by TMVA::operator>>(), TMVA::StatDialogBDTReg::ReadTree(), TMVA::StatDialogBDT::ReadTree(), TMVA::MethodDT::ReadWeightsFromStream(), and SetTotalTreeDepth().

§ ReadXML()

void TMVA::BinaryTree::ReadXML ( void node,
UInt_t  tmva_Version_Code = TMVA_VERSION_CODE 
)
virtual

§ SetRoot()

void TMVA::BinaryTree::SetRoot ( Node r)
inline

§ SetTotalTreeDepth() [1/2]

void TMVA::BinaryTree::SetTotalTreeDepth ( Int_t  depth)
inline

§ SetTotalTreeDepth() [2/2]

void TMVA::BinaryTree::SetTotalTreeDepth ( Node n = NULL)

descend a tree to find all its leaf nodes, fill max depth reached in the tree at the same time.

Definition at line 210 of file BinaryTree.cxx.

Friends And Related Function Documentation

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
const BinaryTree tree 
)
friend

§ operator>>

std::istream& operator>> ( std::istream &  istr,
BinaryTree tree 
)
friend

Member Data Documentation

§ fDepth

UInt_t TMVA::BinaryTree::fDepth
protected

Definition at line 124 of file BinaryTree.h.

Referenced by GetTotalTreeDepth(), and SetTotalTreeDepth().

§ fNNodes

UInt_t TMVA::BinaryTree::fNNodes
protected

§ fRoot

Node* TMVA::BinaryTree::fRoot
protected

Definition at line 116 of file BinaryTree.h.

Referenced by GetRoot(), TMVA::DecisionTree::GetRoot(), ReadXML(), SetRoot(), and ~BinaryTree().


The documentation for this class was generated from the following files: