88 return (
Node*)
n->GetLeft();
96 return (
Node*)
n->GetRight();
106 if (
n == NULL)
return 0 ;
127 os <<
"-1" << std::endl;
136 this->
GetRoot()->AddXMLTo(bdt);
148 fRoot->ReadXML(trnode, tmva_Version_Code);
190 if (currentNode->
GetPos()==
'l') parent->
SetLeft(currentNode);
194 parent = currentNode;
217 Log() << kFATAL <<
"SetTotalTreeDepth: started with undefined ROOT node" <<
Endl;
235 TTHREAD_TLS_DECL_ARG(
MsgLogger,logger,
"BinaryTree");
static ROOT::Experimental::RTreeMapBase::Node CreateNode(const ROOT::Experimental::RNTupleInspector &insp, const ROOT::RFieldDescriptor &fldDesc, std::uint64_t childrenIdx, std::uint64_t nChildren, ROOT::DescriptorId_t rootId, size_t rootSize)
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Base class for BinarySearch and Decision Trees.
UInt_t fDepth
maximal depth in tree reached
UInt_t CountNodes(Node *n=nullptr)
return the number of nodes in the tree. (make a new count --> takes time)
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
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
UInt_t fNNodes
total number of nodes in the tree (counted)
virtual const char * ClassName() const =0
void SetTotalTreeDepth(Int_t depth)
virtual Node * GetRoot() const
Node * fRoot
the root node of the tree the tree only has it's root node, the "daughters" are taken care of by the ...
virtual void Print(std::ostream &os) const
recursively print the tree
virtual ~BinaryTree()
destructor (deletes the nodes and "events" if owned by the tree
virtual void ReadXML(void *node, UInt_t tmva_Version_Code=262657)
read attributes from XML
virtual void Read(std::istream &istr, UInt_t tmva_Version_Code=262657)
Read the binary tree from an input stream.
ostringstream derivative to redirect and format output
Node for the BinarySearch or Decision Trees.
virtual Node * GetLeft() const
virtual Node * GetParent() const
virtual void SetRight(Node *r)
virtual void SetLeft(Node *l)
virtual void SetParent(Node *p)
virtual Bool_t ReadDataRecord(std::istream &, UInt_t tmva_Version_Code=262657)=0
virtual Node * GetRight() const
std::istream & operator>>(std::istream &istr, BinaryTree &tree)
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)
MsgLogger & Endl(MsgLogger &ml)