Logo ROOT   6.08/07
Reference Guide
TBtree.h
Go to the documentation of this file.
1 // @(#)root/cont:$Id$
2 // Author: Fons Rademakers 10/10/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBtree
13 #define ROOT_TBtree
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBtree //
19 // //
20 // Btree class. TBtree inherits from the TSeqCollection ABC. //
21 // //
22 // For a more extensive algorithmic description see the TBtree source. //
23 // //
24 //////////////////////////////////////////////////////////////////////////
25 
26 #ifndef ROOT_TSeqCollection
27 #include "TSeqCollection.h"
28 #endif
29 #ifndef ROOT_TError
30 #include "TError.h"
31 #endif
32 
33 #include <iterator>
34 
35 
36 class TBtNode;
37 class TBtInnerNode;
38 class TBtLeafNode;
39 class TBtreeIter;
40 
41 
42 class TBtree : public TSeqCollection {
43 
44 friend class TBtNode;
45 friend class TBtInnerNode;
46 friend class TBtLeafNode;
47 
48 private:
49  TBtNode *fRoot; //root node of btree
50 
51  Int_t fOrder; //the order of the tree (should be > 2)
52  Int_t fOrder2; //order*2+1 (assumes a memory access is
53  //cheaper than a multiply and increment by one
54  Int_t fInnerLowWaterMark; //inner node low water mark
55  Int_t fLeafLowWaterMark; //leaf low water mark
56  Int_t fInnerMaxIndex; //maximum inner node index
57  Int_t fLeafMaxIndex; //maximum leaf index
58 
59  void Init(Int_t i); //initialize btree
60  void RootIsFull(); //called when the root node is full
61  void RootIsEmpty(); //called when root is empty
62 
63 protected:
64  void IncrNofKeys() { fSize++; }
65  void DecrNofKeys() { fSize--; }
66 
67  // add the object to the tree; return the index in the tree at which
68  // the object was inserted. NOTE: other insertions and deletions may
69  // change this object's index.
70  Int_t IdxAdd(const TObject &obj);
71 
72 public:
74 
75  TBtree(Int_t ordern = 3); //create a TBtree of order n
76  virtual ~TBtree();
77  void Clear(Option_t *option="");
78  void Delete(Option_t *option="");
79  TObject *FindObject(const char *name) const;
80  TObject *FindObject(const TObject *obj) const;
81  TObject **GetObjectRef(const TObject *) const { return 0; }
83 
84  void Add(TObject *obj);
85  void AddFirst(TObject *obj) { Add(obj); }
86  void AddLast(TObject *obj) { Add(obj); }
87  void AddAt(TObject *obj, Int_t) { Add(obj); }
88  void AddAfter(const TObject *, TObject *obj) { Add(obj); }
89  void AddBefore(const TObject *, TObject *obj) { Add(obj); }
90  TObject *Remove(TObject *obj);
91 
92  TObject *At(Int_t idx) const;
93  TObject *Before(const TObject *obj) const;
94  TObject *After(const TObject *obj) const;
95  TObject *First() const;
96  TObject *Last() const;
97 
98  //void PrintOn(std::ostream &os) const;
99 
100  Int_t Order() { return fOrder; }
101  TObject *operator[](Int_t i) const;
102  Int_t Rank(const TObject *obj) const;
103 
104  ClassDef(TBtree,0) //A B-tree
105 };
106 
107 
108 //////////////////////////////////////////////////////////////////////////
109 // //
110 // TBtNode //
111 // //
112 // Abstract base class (ABC) of a TBtree node. //
113 // //
114 //////////////////////////////////////////////////////////////////////////
115 
116 class TBtNode {
117 
118 friend class TBtree;
119 friend class TBtInnerNode;
120 friend class TBtLeafNode;
121 
122 protected:
123  Int_t fLast; // for inner node 1 <= fLast <= fInnerMaxIndex
124  // for leaf node 1 <= fLast <= fLeafMaxIndex
125  // (fLast==0 only temporarily while the tree is being
126  // updated)
127 
128  TBtInnerNode *fParent; // a parent is always an inner node (or 0 for the root)
129  TBtree *fTree; // the tree of which this node is a part
130  Int_t fIsLeaf; // run-time type flag
131 
132 public:
133  TBtNode(Int_t isleaf, TBtInnerNode *p, TBtree *t = 0);
134  virtual ~TBtNode();
135 
136  virtual void Add(const TObject *obj, Int_t index) = 0;
137 #ifndef __CINT__
138  virtual TBtree *GetParentTree() const {return fTree;}
139  virtual void Remove(Int_t index) = 0;
140 
141  virtual TObject *operator[](Int_t i) const = 0;
142  virtual TObject *Found(const TObject *obj, TBtNode **which, Int_t *where) = 0;
143 
144  virtual Int_t FindRank(const TObject *obj) const = 0;
145  virtual Int_t NofKeys() const = 0; // # keys in or below this node
146 
147  virtual TBtLeafNode *FirstLeafNode() = 0;
148  virtual TBtLeafNode *LastLeafNode() = 0;
149 
150  virtual void Split() = 0;
151 #endif
152  // virtual void PrintOn(std::ostream &os) const = 0;
153  // friend std::ostream &operator<<(std::ostream &os, const TBtNode &node);
154 };
155 
156 
157 //////////////////////////////////////////////////////////////////////////
158 // //
159 // TBtItem //
160 // //
161 // Item stored in inner nodes of a TBtree. //
162 // //
163 //////////////////////////////////////////////////////////////////////////
164 
165 class TBtItem {
166 
167 friend class TBtInnerNode;
168 
169 private:
170  Int_t fNofKeysInTree; // number of keys in TBtree
171  TObject *fKey; // key
172  TBtNode *fTree; //! sub-tree
173 
174 public:
175  TBtItem();
176  TBtItem(TBtNode *n, TObject *o);
177  TBtItem(TObject *o, TBtNode *n);
178  ~TBtItem();
179 };
180 
181 
182 //////////////////////////////////////////////////////////////////////////
183 // //
184 // TBtInnerNode //
185 // //
186 // Inner node of a TBtree. //
187 // //
188 //////////////////////////////////////////////////////////////////////////
189 
190 class TBtInnerNode : public TBtNode {
191 
192 private:
193  TBtItem *fItem; // actually fItem[MaxIndex()+1] is desired
194 
195 public:
196  TBtInnerNode(TBtInnerNode *parent, TBtree *t = 0);
197  TBtInnerNode(TBtInnerNode *parent, TBtree *tree, TBtNode *oldroot);
198  ~TBtInnerNode();
199 
200 #ifndef __CINT__
201  void Add(const TObject *obj, Int_t idx);
202  void Add(TBtItem &i, Int_t idx);
203  void Add(Int_t at, TObject *obj, TBtNode *n);
204  void AddElt(TBtItem &itm, Int_t at);
205  void AddElt(Int_t at, TObject *obj, TBtNode *n);
206  void Remove(Int_t idx);
207  void RemoveItem(Int_t idx);
208 
209  TObject *operator[](Int_t i) const;
210  TObject *Found(const TObject *obj, TBtNode **which, Int_t *where);
211 
212  Int_t NofKeys(Int_t idx) const;
213  Int_t NofKeys() const;
214  void SetTree(Int_t i, TBtNode *node) { fItem[i].fTree = node; node->fParent = this; }
215  void SetKey(Int_t i, TObject *obj) { fItem[i].fKey = obj; }
216  void SetItem(Int_t i, TBtItem &itm) { fItem[i] = itm; itm.fTree->fParent = this; }
217  void SetItem(Int_t i, TObject *obj, TBtNode *node) { SetTree(i, node); SetKey(i, obj); }
218  Int_t GetNofKeys(Int_t i) const;
219  void SetNofKeys(Int_t i, Int_t r);
220  Int_t IncNofKeys(Int_t i, Int_t n=1);
221  Int_t DecNofKeys(Int_t i, Int_t n=1);
222  Int_t FindRank(const TObject *obj) const;
223  Int_t FindRankUp(const TBtNode *n) const;
224  TBtNode *GetTree(Int_t i) const { return fItem[i].fTree; }
225  TObject *GetKey(Int_t i) const { return fItem[i].fKey; }
226  TBtItem &GetItem(Int_t i) const { return fItem[i]; }
227 
228  Int_t IndexOf(const TBtNode *n) const;
229  void IncrNofKeys(TBtNode *np);
230  void DecrNofKeys(TBtNode *np);
231 
232  TBtLeafNode *FirstLeafNode();
233  TBtLeafNode *LastLeafNode();
234 
235  void InformParent();
236 
237  void Split();
238  void SplitWith(TBtInnerNode *r, Int_t idx);
239  void MergeWithRight(TBtInnerNode *r, Int_t idx);
240  void BalanceWithLeft(TBtInnerNode *l, Int_t idx);
241  void BalanceWithRight(TBtInnerNode *r, Int_t idx);
242  void BalanceWith(TBtInnerNode *n, int idx);
243  void PushLeft(Int_t cnt, TBtInnerNode *leftsib, Int_t parentIdx);
244  void PushRight(Int_t cnt, TBtInnerNode *rightsib, Int_t parentIdx);
245  void AppendFrom(TBtInnerNode *src, Int_t start, Int_t stop);
246  void Append(TObject *obj, TBtNode *n);
247  void Append(TBtItem &itm);
248  void ShiftLeft(Int_t cnt);
249 
250  Int_t Psize() const { return fLast; }
251  Int_t Vsize() const;
252  Int_t MaxIndex() const { return fTree->fInnerMaxIndex; }
253  Int_t MaxPsize() const { return fTree->fInnerMaxIndex; }
254 
255  // void PrintOn(std::ostream &os) const;
256 
257  Int_t IsFull() const { return fLast == MaxIndex(); }
258  void IsFull(TBtNode *n);
259  Int_t IsAlmostFull() const { return fLast >= MaxIndex() - 1; }
260  Int_t IsLow() const { return fLast < fTree->fInnerLowWaterMark; }
261  void IsLow(TBtNode *n);
262 #endif
263 };
264 
265 
266 //////////////////////////////////////////////////////////////////////////
267 // //
268 // TBtLeafNode //
269 // //
270 // Leaf node of a TBtree. //
271 // //
272 //////////////////////////////////////////////////////////////////////////
273 
274 class TBtLeafNode : public TBtNode {
275 
276 friend class TBtInnerNode;
277 
278 private:
279  TObject **fItem; // actually TObject *fItem[MaxIndex()+1] is desired
280 
281 public:
282  TBtLeafNode(TBtInnerNode *p, const TObject *obj = 0, TBtree *t = 0);
283  ~TBtLeafNode();
284 
285 #ifndef __CINT__
286  void Add(const TObject *obj, Int_t idx);
287  void Remove(Int_t idx);
288  void RemoveItem(Int_t idx) { Remove(idx); }
289 
290  TObject *operator[](Int_t i) const;
291  TObject *Found(const TObject *obj, TBtNode **which, Int_t *where);
292 
293  Int_t NofKeys(Int_t i) const;
294  Int_t NofKeys() const;
295  Int_t FindRank(const TObject *obj) const;
296  TObject *GetKey(Int_t idx ) { return fItem[idx]; }
297  void SetKey(Int_t idx, TObject *obj) { fItem[idx] = obj; }
298 
299  Int_t IndexOf(const TObject *obj) const;
300 
303 
304  void Split();
305  void SplitWith(TBtLeafNode *r, Int_t idx);
306  void MergeWithRight(TBtLeafNode *r, Int_t idx);
307  void BalanceWithLeft(TBtLeafNode *l, Int_t idx);
308  void BalanceWithRight(TBtLeafNode *r, Int_t idx);
309  void BalanceWith(TBtLeafNode *n, Int_t idx);
310  void PushLeft(Int_t cnt, TBtLeafNode *l, Int_t parentIndex);
311  void PushRight(Int_t cnt, TBtLeafNode *r, Int_t parentIndex);
312  void AppendFrom(TBtLeafNode *src, Int_t start, Int_t stop);
313  void Append(TObject *obj);
314  void ShiftLeft(Int_t cnt);
315 
316  Int_t Psize() const { return fLast + 1; }
317  Int_t Vsize() const;
318  Int_t MaxIndex() const { return fTree->fLeafMaxIndex; }
319  Int_t MaxPsize() const { return fTree->fLeafMaxIndex + 1; }
320 
321  // void PrintOn(std::ostream &os) const;
322 
323  Int_t IsFull() const { return fLast == MaxIndex(); }
324  Int_t IsAlmostFull() const { return fLast >= MaxIndex() - 1; }
325  Int_t IsLow() const { return fLast < fTree->fLeafLowWaterMark; }
326 #endif
327 };
328 
329 
330 //////////////////////////////////////////////////////////////////////////
331 // //
332 // TBtreeIter //
333 // //
334 // Iterator of btree. //
335 // //
336 //////////////////////////////////////////////////////////////////////////
337 
338 class TBtreeIter : public TIterator,
339  public std::iterator<std::bidirectional_iterator_tag,
340  TObject*, std::ptrdiff_t,
341  const TObject**, const TObject*&> {
342 
343 private:
344  const TBtree *fTree; //btree being iterated
345  Int_t fCurCursor; //current position in btree
346  Int_t fCursor; //next position in btree
347  Bool_t fDirection; //iteration direction
348 
349  TBtreeIter() : fTree(0), fCurCursor(0), fCursor(0), fDirection(kIterForward) { }
350 
351 public:
352  TBtreeIter(const TBtree *t, Bool_t dir = kIterForward);
353  TBtreeIter(const TBtreeIter &iter);
355  TIterator &operator=(const TIterator &rhs);
356  TBtreeIter &operator=(const TBtreeIter &rhs);
357 
358  const TCollection *GetCollection() const { return fTree; }
359  TObject *Next();
360  void Reset();
361  Bool_t operator!=(const TIterator &aIter) const;
362  Bool_t operator!=(const TBtreeIter &aIter) const;
363  TObject *operator*() const;
364 
365  ClassDef(TBtreeIter,0) //B-tree iterator
366 };
367 
368 
369 //----- TBtree inlines ---------------------------------------------------------
370 
372 {
373  return (*fRoot)[i];
374 }
375 
376 inline TObject *TBtree::At(Int_t i) const
377 {
378  return (*fRoot)[i];
379 }
380 
381 inline TObject *TBtree::First() const
382 {
383  return (*fRoot)[0];
384 }
385 
386 inline TObject *TBtree::Last() const
387 {
388  return (*fRoot)[fSize-1];
389 }
390 
391 //----- TBtInnerNode inlines ---------------------------------------------------
392 
394 {
395  R__ASSERT(i >= 0 && i <= fLast);
396  return fItem[i].fNofKeysInTree;
397 }
398 
400 {
401  return GetNofKeys(idx);
402 }
403 
405 {
406  fItem[i].fNofKeysInTree = r;
407 }
408 
410 {
411  return (fItem[i].fNofKeysInTree += n);
412 }
413 
415 {
416  return (fItem[i].fNofKeysInTree -= n);
417 }
418 
420 {
421  R__ASSERT(fParent != 0 && fParent->GetTree(0) != (const TBtNode *)this);
422  return Psize()+1;
423 }
424 
425 
426 //----- TBtLeafNode inlines ----------------------------------------------------
427 
429 {
430  R__ASSERT(i >= 0 && i <= fLast);
431  return fItem[i];
432 }
433 
434 inline Int_t TBtLeafNode::Vsize() const
435 {
436  R__ASSERT(fParent != 0 && fParent->GetTree(0) != (const TBtNode *)this);
437  return Psize()+1;
438 }
439 
440 //inline std::ostream &operator<<(std::ostream& outputStream, const TBtNode &aNode)
441 //{
442 // aNode.PrintOn(outputStream);
443 // return outputStream;
444 //}
445 
446 #endif
void SetItem(Int_t i, TBtItem &itm)
Definition: TBtree.h:216
friend class TBtInnerNode
Definition: TBtree.h:45
TObject * Before(const TObject *obj) const
May not use this method since B-tree decides order.
Definition: TBtree.cxx:236
void SetKey(Int_t idx, TObject *obj)
Definition: TBtree.h:297
#define Split(a, ahi, alo)
Definition: triangle.c:4775
const TBtree * fTree
Definition: TBtree.h:344
Int_t IsFull() const
Definition: TBtree.h:257
Int_t fLeafMaxIndex
Definition: TBtree.h:57
void SetItem(Int_t i, TObject *obj, TBtNode *node)
Definition: TBtree.h:217
TBtItem * fItem
Definition: TBtree.h:193
Int_t GetNofKeys(Int_t i) const
Definition: TBtree.h:393
void AddLast(TObject *obj)
Definition: TBtree.h:86
TObject * GetKey(Int_t i) const
Definition: TBtree.h:225
Int_t DecNofKeys(Int_t i, Int_t n=1)
Definition: TBtree.h:414
void AppendFrom(TBtInnerNode *src, Int_t start, Int_t stop)
This should never create a full node that is, it is not used anywhere where THIS could possibly be ne...
Definition: TBtree.cxx:776
Leaf node of a TBtree.
Definition: TBtree.h:274
TBtreeIter Iterator_t
Definition: TBtree.h:73
TObject * operator[](Int_t i) const
Definition: TBtree.h:371
Int_t fLeafLowWaterMark
Definition: TBtree.h:55
void SetNofKeys(Int_t i, Int_t r)
Definition: TBtree.h:404
virtual TBtree * GetParentTree() const
Definition: TBtree.h:138
const char Option_t
Definition: RtypesCore.h:62
Int_t fInnerMaxIndex
Definition: TBtree.h:56
Int_t Rank(const TObject *obj) const
Returns the rank of the object in the tree.
Definition: TBtree.cxx:392
TObject * FindObject(const char *name) const
Find object using its name (see object&#39;s GetName()).
Definition: TBtree.cxx:274
Int_t MaxPsize() const
Definition: TBtree.h:253
Int_t NofKeys() const
Return the number of keys.
Definition: TBtree.cxx:1574
void RemoveItem(Int_t idx)
Definition: TBtree.h:288
void Add(TObject *obj)
Add object to B-tree.
Definition: TBtree.cxx:199
Int_t Psize() const
Definition: TBtree.h:316
virtual ~TBtree()
Delete B-tree.
Definition: TBtree.cxx:188
Abstract base class (ABC) of a TBtree node.
Definition: TBtree.h:116
TBtLeafNode * FirstLeafNode()
Return the first node.
Definition: TBtree.cxx:1500
void AddAfter(const TObject *, TObject *obj)
Definition: TBtree.h:88
TBtree * fTree
Definition: TBtree.h:129
#define R__ASSERT(e)
Definition: TError.h:98
void RootIsEmpty()
If root is empty clean up its space.
Definition: TBtree.cxx:440
Int_t NofKeys() const
Number of key.
Definition: TBtree.cxx:1135
Int_t Order()
Definition: TBtree.h:100
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void Clear(Option_t *option="")
Remove all objects from B-tree.
Definition: TBtree.cxx:246
~TBtreeIter()
Definition: TBtree.h:354
void DecrNofKeys()
Definition: TBtree.h:65
virtual ~TBtNode()
Delete a B-tree node.
Definition: TBtree.cxx:563
TBtNode * fRoot
Definition: TBtree.h:49
void BalanceWithRight(TBtInnerNode *r, Int_t idx)
THIS has more than RIGHTSIB.
Definition: TBtree.cxx:825
Int_t IdxAdd(const TObject &obj)
Add object and return its index in the tree.
Definition: TBtree.cxx:300
Iterator abstract base class.
Definition: TIterator.h:32
TObject * operator[](Int_t i) const
Definition: TBtree.h:428
void PushLeft(Int_t cnt, TBtInnerNode *leftsib, Int_t parentIdx)
noFromThis==1 => moves the parent item into the leftsib, and the first item in this&#39;s array into the ...
Definition: TBtree.cxx:1169
Bool_t fDirection
Definition: TBtree.h:347
Sequenceable collection abstract base class.
void SetTree(Int_t i, TBtNode *node)
Definition: TBtree.h:214
Int_t IsFull() const
Definition: TBtree.h:323
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t fCursor
Definition: TBtree.h:346
TObject * Found(const TObject *obj, TBtNode **which, Int_t *where)
Recursively look for WHAT starting in the current node.
Definition: TBtree.cxx:909
Item stored in inner nodes of a TBtree.
Definition: TBtree.h:165
TObject * GetKey(Int_t idx)
Definition: TBtree.h:296
TBtLeafNode * LastLeafNode()
Return the last leaf node.
Definition: TBtree.cxx:1112
const Bool_t kIterForward
Definition: TCollection.h:43
TObject * Last() const
Definition: TBtree.h:386
Bool_t operator!=(const TDatime &d1, const TDatime &d2)
Definition: TDatime.h:103
Int_t FindRank(const TObject *obj) const
WHAT was not in any inner node; it is either here, or it&#39;s not in the tree.
Definition: TBtree.cxx:1486
Int_t MaxIndex() const
Definition: TBtree.h:318
TBtItem & GetItem(Int_t i) const
Definition: TBtree.h:226
TBtNode * fTree
Definition: TBtree.h:172
TBtLeafNode * LastLeafNode()
return the last node.
Definition: TBtree.cxx:1545
Int_t fNofKeysInTree
Definition: TBtree.h:170
void MergeWithRight(TBtInnerNode *r, Int_t idx)
Merge the 2 part of the tree.
Definition: TBtree.cxx:1120
Int_t fOrder2
Definition: TBtree.h:52
Int_t fOrder
Definition: TBtree.h:51
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns a B-tree iterator.
Definition: TBtree.cxx:384
Int_t Vsize() const
Definition: TBtree.h:434
friend class TBtLeafNode
Definition: TBtree.h:46
Int_t MaxPsize() const
Definition: TBtree.h:319
TRandom2 r(17)
Int_t fCurCursor
Definition: TBtree.h:345
Int_t fIsLeaf
Definition: TBtree.h:130
void Append(TObject *obj, TBtNode *n)
Never called from anywhere where it might fill up THIS.
Definition: TBtree.cxx:790
TTime operator*(const TTime &t1, const TTime &t2)
Definition: TTime.h:87
TObject * fKey
Definition: TBtree.h:171
friend class TBtNode
Definition: TBtree.h:44
Collection abstract base class.
Definition: TCollection.h:48
Int_t IsLow() const
Definition: TBtree.h:260
TObject ** GetObjectRef(const TObject *) const
Definition: TBtree.h:81
void RootIsFull()
The root of the tree is full.
Definition: TBtree.cxx:429
Int_t fLast
Definition: TBtree.h:123
TLine * l
Definition: textangle.C:4
Int_t fSize
Definition: TCollection.h:63
TObject * At(Int_t idx) const
Definition: TBtree.h:376
TObject * After(const TObject *obj) const
Cannot use this method since B-tree decides order.
Definition: TBtree.cxx:227
void Init(Int_t i)
Initialize a B-tree.
Definition: TBtree.cxx:343
void Reset(Detail::TBranchProxy *x)
TBtree(Int_t ordern=3)
Create a B-tree of certain order (by default 3).
Definition: TBtree.cxx:179
Int_t Psize() const
Definition: TBtree.h:250
Int_t IsAlmostFull() const
Definition: TBtree.h:324
void AddAt(TObject *obj, Int_t)
Definition: TBtree.h:87
Iterator of btree.
Definition: TBtree.h:338
void AddFirst(TObject *obj)
Definition: TBtree.h:85
TBtreeIter()
Definition: TBtree.h:349
TObject * Remove(TObject *obj)
Remove an object from the tree.
Definition: TBtree.cxx:407
Int_t IncNofKeys(Int_t i, Int_t n=1)
Definition: TBtree.h:409
Int_t IsAlmostFull() const
Definition: TBtree.h:259
void IncrNofKeys()
Definition: TBtree.h:64
void SetKey(Int_t i, TObject *obj)
Definition: TBtree.h:215
void Delete(Option_t *option="")
Remove all objects from B-tree AND delete all heap based objects.
Definition: TBtree.cxx:259
void BalanceWithLeft(TBtInnerNode *l, Int_t idx)
THIS has more than LEFTSIB.
Definition: TBtree.cxx:811
const TCollection * GetCollection() const
Definition: TBtree.h:358
Int_t FindRank(const TObject *obj) const
Recursively look for WHAT starting in the current node.
Definition: TBtree.cxx:862
void PushRight(Int_t cnt, TBtInnerNode *rightsib, Int_t parentIdx)
The operation is three steps:
Definition: TBtree.cxx:1188
TObject * First() const
Definition: TBtree.h:381
void AddBefore(const TObject *, TObject *obj)
Definition: TBtree.h:89
Mother of all ROOT objects.
Definition: TObject.h:37
Int_t Vsize() const
Definition: TBtree.h:419
TObject * Found(const TObject *obj, TBtNode **which, Int_t *where)
WHAT was not in any inner node; it is either here, or it&#39;s not in the tree.
Definition: TBtree.cxx:1509
void operator=(const TCollection &)
TBtLeafNode * FirstLeafNode()
Return the first leaf node.
Definition: TBtree.cxx:901
void ShiftLeft(Int_t cnt)
Shift to the left.
Definition: TBtree.cxx:1262
Definition: tree.py:1
Int_t MaxIndex() const
Definition: TBtree.h:252
void SplitWith(TBtInnerNode *r, Int_t idx)
THIS and SIB are too full; create a NEWNODE, and balance the number of keys between the three of them...
Definition: TBtree.cxx:1315
Inner node of a TBtree.
Definition: TBtree.h:190
TBtNode * GetTree(Int_t i) const
Definition: TBtree.h:224
TObject ** fItem
Definition: TBtree.h:279
Int_t fInnerLowWaterMark
Definition: TBtree.h:54
const Int_t n
Definition: legend1.C:16
B-tree class.
Definition: TBtree.h:42
char name[80]
Definition: TGX11.cxx:109
const char * cnt
Definition: TXMLSetup.cxx:75
TBtInnerNode * fParent
Definition: TBtree.h:128
Int_t IsLow() const
Definition: TBtree.h:325
void BalanceWith(TBtInnerNode *n, int idx)
PINDX is the index of the parent item whose key will change when keys are shifted from one InnerNode ...
Definition: TBtree.cxx:838
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.