71 fDepth(
p->GetDepth() + 1),
72 fParentTree(
p->GetParentTree())
75 if (
fPos ==
'l' )
p->SetLeft(
this);
76 else if (
fPos ==
'r' )
p->SetRight(
this);
117 if (this->GetLeft() != NULL)
118 n+= this->GetLeft()->CountMeAndAllDaughters();
119 if (this->GetRight() != NULL)
120 n+= this->GetRight()->CountMeAndAllDaughters();
140 if (node!=NULL) node->
Print(os);
149 std::stringstream s(
"");
154 this->AddAttributesToNode(node);
155 if (this->GetLeft()) this->GetLeft()->AddXMLTo(node);
156 if (this->GetRight()) this->GetRight()->AddXMLTo(node);
165 ReadAttributes(node, tmva_Version_Code);
168 std::stringstream s(content);
176 Node*
n = CreateNode();
177 n->ReadXML(ch, tmva_Version_Code);
178 if (
n->GetPos()==
'l') { this->SetLeft(
n); }
179 else if(
n->GetPos()==
'r') { this->SetRight(
n); }
181 std::cout <<
"neither left nor right" << std::endl;
winID h TVirtualViewer3D TVirtualGLPainter p
Node for the BinarySearch or Decision Trees.
static Int_t fgCount
counter of all nodes present.. for debug.. to spot memory leaks...
virtual void Print(std::ostream &os) const =0
char fPos
position, i.e. it is a left (l) or right (r) daughter
void * AddXMLTo(void *parent) const
add attributes to XML
int GetCount()
returns the global number of instantiated nodes
Int_t CountMeAndAllDaughters() const
recursively go through the part of the tree below this node and count all daughters
virtual ~Node()
node destructor
void ReadXML(void *node, UInt_t tmva_Version_Code=262657)
read attributes from XML
std::ostream & operator<<(std::ostream &os, const BinaryTree &tree)