#include <G4KDMap.hh>
Definition at line 91 of file G4KDMap.hh.
◆ G4KDMap()
G4KDMap::G4KDMap |
( |
std::size_t |
dimensions | ) |
|
|
inline |
Definition at line 94 of file G4KDMap.hh.
95 {
96 fIsSorted = false;
97
98
99
100
101 }
◆ GetDimension()
std::size_t G4KDMap::GetDimension |
( |
| ) |
|
|
inline |
Definition at line 107 of file G4KDMap.hh.
108 {
109 return fSortOut.size();
110 }
◆ GetSize()
std::size_t G4KDMap::GetSize |
( |
| ) |
|
|
inline |
◆ Insert()
Definition at line 90 of file G4KDMap.cc.
91{
92 vector<_deq_iterator>& vit = fMap[
pos];
93
94 std::size_t maxSize = fSortOut.size();
95
97
98 vit.reserve(maxSize);
99
100 for (std::size_t i = 0; i < fSortOut.size(); ++i)
101 {
102 vit[i] = fSortOut[i].Insert(pos);
103
104
105
106
107
108
109 }
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134 fIsSorted = false;
135}
G4GLOB_DLL std::ostream G4cout
Referenced by G4KDTree::__InsertMap().
◆ PopOutMiddle()
Definition at line 137 of file G4KDMap.cc.
138{
140 G4cout <<
"G4KDMap::PopOutMiddle ( "<< dimension <<
" )" <<
G4endl;
141
142 if(fIsSorted ==
false)
Sort();
143 G4KDNode_Base* output_node = fSortOut[dimension].PopOutMiddle();
144
145 if(output_node == 0) return 0;
146
149
150 std::map<G4KDNode_Base*, std::vector<_deq_iterator> >::iterator fMap_it
151 = fMap.find(output_node);
152
153
154 if(fMap_it == fMap.end())
155 {
158 return output_node;
159 }
160
161 std::vector<_deq_iterator>& vit = fMap_it->second;
162
163
164
165
166
167
168
169
170
171
172 for(std::size_t i = 0; i < fSortOut.size(); ++i)
173 {
174 if(i != dimension)
175 {
177
178
179
180
181
182
183
184
185
186
187 fSortOut[i].Erase(vit[i]);
188 }
189 }
190
191 fMap.erase(fMap_it);
192
193 return output_node;
194}
Referenced by G4KDTree::Build().
◆ Sort()
Definition at line 196 of file G4KDMap.cc.
197{
198 for (std::size_t i = 0; i < fSortOut.size(); ++i)
199 {
200 fSortOut[i].Sort();
201 }
202
203 fIsSorted = true;
204}
Referenced by PopOutMiddle().
The documentation for this class was generated from the following files: