Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::BinaryTree Class Referenceabstract

Base class for BinarySearch and Decision Trees.

Definition at line 62 of file BinaryTree.h.

Public Member Functions

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

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Member Functions

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

Protected Attributes

UInt_t fDepth
 maximal depth in tree reached
 
UInt_t fNNodes
 total number of nodes in the tree (counted)
 
NodefRoot
 the root node of the tree the tree only has it's root node, the "daughters" are taken care of by the "node" properties of the "root"
 

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:
[legend]

Constructor & Destructor Documentation

◆ BinaryTree()

TMVA::BinaryTree::BinaryTree ( void  )

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

Definition at line 55 of file BinaryTree.cxx.

◆ ~BinaryTree()

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

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

Definition at line 65 of file BinaryTree.cxx.

Member Function Documentation

◆ AddXMLTo()

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

add attributes to XML

Definition at line 134 of file BinaryTree.cxx.

◆ Class()

static TClass * TMVA::BinaryTree::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TMVA::BinaryTree::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TMVA::BinaryTree::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 122 of file BinaryTree.h.

◆ ClassName()

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

◆ CountNodes()

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

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

Definition at line 103 of file BinaryTree.cxx.

◆ CreateNode()

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

◆ CreateTree()

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

◆ DeclFileName()

static const char * TMVA::BinaryTree::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 122 of file BinaryTree.h.

◆ DeleteNode()

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

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

Definition at line 74 of file BinaryTree.cxx.

◆ GetLeftDaughter()

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

get left daughter node current node "n"

Definition at line 87 of file BinaryTree.cxx.

◆ GetNNodes()

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

Definition at line 86 of file BinaryTree.h.

◆ GetRightDaughter()

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

get right daughter node current node "n"

Definition at line 95 of file BinaryTree.cxx.

◆ GetRoot()

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

Reimplemented in TMVA::DecisionTree.

Definition at line 83 of file BinaryTree.h.

◆ GetTotalTreeDepth()

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

Definition at line 93 of file BinaryTree.h.

◆ IsA()

virtual TClass * TMVA::BinaryTree::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

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

Definition at line 122 of file BinaryTree.h.

◆ Log()

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

Definition at line 235 of file BinaryTree.cxx.

◆ Print()

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

recursively print the tree

Definition at line 125 of file BinaryTree.cxx.

◆ Read()

void TMVA::BinaryTree::Read ( std::istream &  istr,
UInt_t  tmva_Version_Code = 262657 
)
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 169 of file BinaryTree.cxx.

◆ ReadXML()

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

read attributes from XML

Definition at line 144 of file BinaryTree.cxx.

◆ SetRoot()

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

Definition at line 80 of file BinaryTree.h.

◆ SetTotalTreeDepth() [1/2]

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

Definition at line 95 of file BinaryTree.h.

◆ SetTotalTreeDepth() [2/2]

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

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

Definition at line 213 of file BinaryTree.cxx.

◆ Streamer()

virtual void TMVA::BinaryTree::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void TMVA::BinaryTree::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 122 of file BinaryTree.h.

Friends And Related Symbol 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

maximal depth in tree reached

Definition at line 118 of file BinaryTree.h.

◆ fNNodes

UInt_t TMVA::BinaryTree::fNNodes
protected

total number of nodes in the tree (counted)

Definition at line 117 of file BinaryTree.h.

◆ fRoot

Node* TMVA::BinaryTree::fRoot
protected

the root node of the tree the tree only has it's root node, the "daughters" are taken care of by the "node" properties of the "root"

Definition at line 110 of file BinaryTree.h.

Libraries for TMVA::BinaryTree:

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