#include <Node.h>
Public Member Functions | |
| Node (const Node *parent, const Event &event, int mod) | |
| ~Node () | |
| const Node * | Add (const Event &event, unsigned int depth) |
| void | SetNodeL (Node *node) |
| void | SetNodeR (Node *node) |
| const Event & | GetEvent () const |
| const Node * | GetNodeL () const |
| const Node * | GetNodeR () const |
| const Node * | GetNodeP () const |
| double | GetWeight () const |
| short | GetType () const |
| VarType | GetVarDis () const |
| VarType | GetVarMin () const |
| VarType | GetVarMax () const |
| unsigned int | GetMod () const |
| void | Print () const |
| void | Print (std::ostream &os, const std::string &offset="") const |
Private Member Functions | |
| Node () | |
| Node (const Node &) | |
| const Node & | operator= (const Node &) |
Private Attributes | |
| const Node * | fNodeP |
| Node * | fNodeL |
| Node * | fNodeR |
| const Event | fEvent |
| const VarType | fVarDis |
| VarType | fVarMin |
| VarType | fVarMax |
| const unsigned int | fMod |
|
||||||||||||||||
|
Definition at line 9 of file Node.cxx. 00010 :fNodeP(parent), 00011 fNodeL(0), 00012 fNodeR(0), 00013 fEvent(event), 00014 fVarDis(event.GetVar(mod)), 00015 fVarMin(fVarDis), 00016 fVarMax(fVarDis), 00017 fMod(mod) 00018 { 00019 }
|
|
|
Definition at line 22 of file Node.cxx. 00023 {
00024 if(fNodeL) delete fNodeL;
00025 if(fNodeR) delete fNodeR;
00026 }
|
|
|
Referenced by Add(). |
|
|
|
|
||||||||||||
|
Definition at line 29 of file Node.cxx. References fMod, fNodeL, fNodeR, fVarMax, fVarMin, Lit::Event::GetNVar(), Lit::Event::GetVar(), max, min, Node(), and Lit::VarType. 00030 {
00031 assert(fMod == depth % event.GetNVar());
00032
00033 const VarType value = event.GetVar(fMod);
00034
00035 fVarMin = std::min(fVarMin, value);
00036 fVarMax = std::max(fVarMax, value);
00037
00038 Node *node = 0;
00039 if(value < fVarDis)
00040 {
00041 if(fNodeL)
00042 {
00043 return fNodeL -> Add(event, depth + 1);
00044 }
00045 else
00046 {
00047 fNodeL = new Node(this, event, (depth + 1) % event.GetNVar());
00048 node = fNodeL;
00049 }
00050 }
00051 else
00052 {
00053 if(fNodeR)
00054 {
00055 return fNodeR -> Add(event, depth + 1);
00056 }
00057 else
00058 {
00059 fNodeR = new Node(this, event, (depth + 1) % event.GetNVar());
00060 node = fNodeR;
00061 }
00062 }
00063
00064 return node;
00065 }
|
|
|
Definition at line 88 of file Node.h. 00089 {
00090 return fEvent;
00091 }
|
|
|
Definition at line 124 of file Node.h. 00125 {
00126 return fMod;
00127 }
|
|
|
Definition at line 92 of file Node.h. 00093 {
00094 return fNodeL;
00095 }
|
|
|
Definition at line 100 of file Node.h. 00101 {
00102 return fNodeP;
00103 }
|
|
|
Definition at line 96 of file Node.h. 00097 {
00098 return fNodeR;
00099 }
|
|
|
Definition at line 108 of file Node.h. References fEvent, and Lit::Event::GetType(). Referenced by Anp::FillkNN::Find(), and Anp::FillkNN::PidKer(). 00109 {
00110 return fEvent.GetType();
00111 }
|
|
|
Definition at line 112 of file Node.h. References Lit::VarType. 00113 {
00114 return fVarDis;
00115 }
|
|
|
Definition at line 120 of file Node.h. References Lit::VarType. 00121 {
00122 return fVarMax;
00123 }
|
|
|
Definition at line 116 of file Node.h. References Lit::VarType. 00117 {
00118 return fVarMin;
00119 }
|
|
|
Definition at line 104 of file Node.h. References fEvent, and Lit::Event::GetWeight(). Referenced by Anp::FillkNN::Find(), Anp::FillkNN::PidKer(), and Print(). 00105 {
00106 return fEvent.GetWeight();
00107 }
|
|
|
|
|
||||||||||||
|
Definition at line 294 of file Node.cxx. References fMod, fNodeL, fNodeR, fVarDis, GetWeight(), and Print(). 00295 {
00296 os << offset << "-----------------------------------------------------------" << std::endl;
00297 os << offset << "Node: mod " << fMod
00298 << " at " << fVarDis
00299 << " with weight: " << GetWeight() << std::endl
00300 << offset << fEvent;
00301
00302 if(fNodeL)
00303 {
00304 os << offset << "Has left node " << std::endl;
00305 }
00306 if(fNodeR)
00307 {
00308 os << offset << "Has right node" << std::endl;
00309 }
00310
00311 if(fNodeL)
00312 {
00313 os << offset << "Print left node " << std::endl;
00314 fNodeL -> Print(os, offset + " ");
00315 }
00316 if(fNodeR)
00317 {
00318 os << offset << "Print right node" << std::endl;
00319 fNodeR -> Print(os, offset + " ");
00320 }
00321
00322 if(!fNodeL && !fNodeR)
00323 {
00324 os << std::endl;
00325 }
00326 }
|
|
|
Definition at line 288 of file Node.cxx. Referenced by Lit::operator<<(), and Print(). 00289 {
00290 Print(std::cout);
00291 }
|
|
|
Definition at line 80 of file Node.h. References fNodeL. 00081 {
00082 fNodeL = node;
00083 }
|
|
|
Definition at line 84 of file Node.h. References fNodeR. 00085 {
00086 fNodeR = node;
00087 }
|
|
|
Definition at line 68 of file Node.h. Referenced by GetType(), and GetWeight(). |
|
|
|
|
|
Definition at line 65 of file Node.h. Referenced by Add(), Print(), and SetNodeL(). |
|
|
|
|
|
Definition at line 66 of file Node.h. Referenced by Add(), Print(), and SetNodeR(). |
|
|
Definition at line 70 of file Node.h. Referenced by Print(). |
|
|
Definition at line 73 of file Node.h. Referenced by Add(). |
|
|
Definition at line 72 of file Node.h. Referenced by Add(). |
1.3.9.1