38 return (*lhs)[fDimension] < (*rhs)[fDimension];
42 fSortOutNDim(dimension)
47 fContainer(right.fContainer), fSortOutNDim(right.fSortOutNDim)
59 main_middle = (size_t) ceil(contSize / 2.);
92 vector<_deq_iterator>& vit = fMap[
pos];
94 size_t maxSize = fSortOut.size();
101 for (
size_t i = 0; i < fSortOut.size(); ++i)
103 vit[i] = fSortOut[i].Insert(pos);
141 G4cout <<
"G4KDMap::PopOutMiddle ( "<< dimension <<
" )" <<
G4endl;
143 if(fIsSorted ==
false)
Sort();
144 G4KDNode_Base* output_node = fSortOut[dimension].PopOutMiddle();
146 if(output_node == 0)
return 0;
151 std::map<G4KDNode_Base*, std::vector<_deq_iterator> >::iterator fMap_it
152 = fMap.find(output_node);
155 if(fMap_it == fMap.end())
162 std::vector<_deq_iterator>& vit = fMap_it->second;
173 for(
size_t i = 0; i < fSortOut.size(); i++)
188 fSortOut[i].Erase(vit[i]);
199 for (
size_t i = 0; i < fSortOut.size(); ++i)
std::deque< G4KDNode_Base * > fContainer
std::deque< G4KDNode_Base * >::iterator _deq_iterator
G4KDNode_Base * PopOutMiddle(size_t dimension)
G4KDNode_Base * PopOutMiddle()
bool operator()(G4KDNode_Base *const &lhs, G4KDNode_Base *const &rhs)
G4GLOB_DLL std::ostream G4cout
void Erase(std::deque< G4KDNode_Base * >::iterator &)
__1DSortOut(size_t dimension)
std::deque< G4KDNode_Base * >::iterator Insert(G4KDNode_Base *)
G4KDNode_Base * GetMidle(size_t &)
void Insert(G4KDNode_Base *pos)
static const G4double pos