cheshirekow  v0.1.0
node.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 Josh Bialkowski (jbialk@mit.edu)
3  *
4  * This file is part of mpblocks.
5  *
6  * mpblocks is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * mpblocks is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mpblocks. If not, see <http://www.gnu.org/licenses/>.
18  */
27 #ifndef MPBLOCKS_BTPS_NODE_H_
28 #define MPBLOCKS_BTPS_NODE_H_
29 
30 #include <cstdint>
31 
32 namespace mpblocks {
33 namespace btps {
34 
36 template <typename Traits>
37 struct BasicNode {
38  typedef typename Traits::NodeRef NodeRef;
39 
40  uint32_t count;
41  double weight;
42  double cumweight;
46 
48 };
49 
50 } //< namespace btps
51 } //< namespace mpblocks
52 
53 #endif // NODE_H_
NodeRef left
left child
Definition: node.h:44
double cumweight
cumulative weight of children
Definition: node.h:42
A node in a btps tree.
Definition: node.h:37
uint32_t count
count of subtree descendants
Definition: node.h:40
this type is not required by the interface, but if you just need a simple node type then this one wil...
NodeRef right
right child
Definition: node.h:45
double weight
the weight of this node
Definition: node.h:41
Traits::NodeRef NodeRef
Definition: node.h:38
NodeRef parent
only needed if we want removal
Definition: node.h:43
BasicNode(double weight=0)
Definition: node.h:47