Changeset 2670 for GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h
- Timestamp:
- 04/30/08 13:24:45 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.h
r2643 r2670 69 69 int Leaves() const { return (nodes / 2) + 1; } 70 70 71 void Reset() { 72 nodes = 0; 73 for (int i=0; i<7; i++) 74 splits[i] = 0; 75 rays = queryDomains = 0; 76 rayRefs = rayRefsNonZeroQuery = objectRefs = 0; 77 zeroQueryNodes = 0; 78 maxDepthNodes = 0; 79 minCostNodes = 0; 80 maxObjectRefs = 0; 81 addedRayRefs = removedRayRefs = 0; 71 void Reset() 72 { 73 nodes = 0; 74 for (int i=0; i<7; i++) 75 splits[i] = 0; 76 rays = queryDomains = 0; 77 rayRefs = rayRefsNonZeroQuery = objectRefs = 0; 78 zeroQueryNodes = 0; 79 maxDepthNodes = 0; 80 minCostNodes = 0; 81 maxObjectRefs = 0; 82 addedRayRefs = removedRayRefs = 0; 82 83 } 83 84 … … 94 95 95 96 class KdInterior; 96 /** Abstract class for kd-tree node */ 97 class KdNode { 97 98 /** Abstract class for kd-tree node 99 */ 100 class KdNode 101 { 98 102 99 103 public: … … 112 116 bool Mailed() const { return mMailbox == sMailId; } 113 117 114 static void NewMail(const int reserve = 1) { 115 sMailId += sReservedMailboxes; 116 sReservedMailboxes = reserve; 117 } 118 static void NewMail(const int reserve = 1) 119 { 120 sMailId += sReservedMailboxes; 121 sReservedMailboxes = reserve; 122 } 123 118 124 void Mail(const int mailbox) { mMailbox = sMailId + mailbox; } 119 125 bool Mailed(const int mailbox) const { return mMailbox == sMailId + mailbox; } 120 126 121 127 122 static void NewMail2(const int reserve = 1) { 123 sMailId2 += sReservedMailboxes; 124 sReservedMailboxes2 = reserve; 128 //////////// 129 //-- hack!!: second mail for a machine with 2 cores 130 131 static void NewMail2(const int reserve = 1) 132 { 133 sMailId2 += sReservedMailboxes; 134 sReservedMailboxes2 = reserve; 125 135 } 126 136 … … 130 140 void Mail2(const int mailbox) { mMailbox2 = sMailId2 + mailbox; } 131 141 bool Mailed2(const int mailbox) const { return mMailbox2 == sMailId2 + mailbox; } 142 143 ///////////////////////////////////// 132 144 133 145 … … 154 166 }; 155 167 156 /** Implementation of the kd-tree interior node */ 168 169 /** Implementation of the kd-tree interior node. 170 */ 157 171 class KdInterior : public KdNode { 158 172
Note: See TracChangeset
for help on using the changeset viewer.