Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
__1DSortOut Class Reference

#include <G4KDMap.hh>

Collaboration diagram for __1DSortOut:

Classes

struct  sortOutNDim
 

Public Member Functions

 __1DSortOut (size_t dimension)
 
 __1DSortOut (const __1DSortOut &right)
 
int GetDimension ()
 
G4KDNode_BaseGetMidle (size_t &)
 
std::deque< G4KDNode_Base * >
::iterator 
Insert (G4KDNode_Base *)
 
G4KDNode_BasePopOutMiddle ()
 
void Sort ()
 
void Erase (std::deque< G4KDNode_Base * >::iterator &)
 
size_t Size ()
 

Protected Attributes

std::deque< G4KDNode_Base * > fContainer
 
sortOutNDim fSortOutNDim
 

Detailed Description

Definition at line 57 of file G4KDMap.hh.

Constructor & Destructor Documentation

__1DSortOut::__1DSortOut ( size_t  dimension)

Definition at line 41 of file G4KDMap.cc.

41  :
42  fSortOutNDim(dimension)
43 {
44 }
sortOutNDim fSortOutNDim
Definition: G4KDMap.hh:86
__1DSortOut::__1DSortOut ( const __1DSortOut right)

Definition at line 46 of file G4KDMap.cc.

46  :
48 {
49 }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85
sortOutNDim fSortOutNDim
Definition: G4KDMap.hh:86

Member Function Documentation

void __1DSortOut::Erase ( std::deque< G4KDNode_Base * >::iterator &  deq_pos)

Definition at line 85 of file G4KDMap.cc.

86 {
87  fContainer.erase(deq_pos);
88 }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85
int __1DSortOut::GetDimension ( )

Definition at line 51 of file G4KDMap.cc.

52 {
53  return fSortOutNDim.fDimension;
54 }
sortOutNDim fSortOutNDim
Definition: G4KDMap.hh:86
G4KDNode_Base * __1DSortOut::GetMidle ( size_t &  main_middle)

Definition at line 56 of file G4KDMap.cc.

57 {
58  size_t contSize = fContainer.size();
59  main_middle = (size_t) ceil(contSize / 2.); // ceil = round up
60  return fContainer[main_middle];
61 }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85

Here is the caller graph for this function:

_deq_iterator __1DSortOut::Insert ( G4KDNode_Base pos)

Definition at line 63 of file G4KDMap.cc.

64 {
65  return fContainer.insert(fContainer.end(), pos);
66 }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85
static const G4double pos
G4KDNode_Base * __1DSortOut::PopOutMiddle ( )

Definition at line 68 of file G4KDMap.cc.

69 {
70  size_t middle;
71  G4KDNode_Base* pos = GetMidle(middle);
72  _deq_iterator deq_pos = fContainer.begin() + middle;
73 
74  if(deq_pos == fContainer.end()) return 0; // this is a double check
75 
76  fContainer.erase(deq_pos);
77  return pos;
78 }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85
std::deque< G4KDNode_Base * >::iterator _deq_iterator
Definition: G4KDMap.cc:33
G4KDNode_Base * GetMidle(size_t &)
Definition: G4KDMap.cc:56
static const G4double pos

Here is the call graph for this function:

size_t __1DSortOut::Size ( )
inline

Definition at line 69 of file G4KDMap.hh.

70  {
71  return fContainer.size();
72  }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85
void __1DSortOut::Sort ( )

Definition at line 80 of file G4KDMap.cc.

81 {
82  sort(fContainer.begin(), fContainer.end(), fSortOutNDim);
83 }
std::deque< G4KDNode_Base * > fContainer
Definition: G4KDMap.hh:85
sortOutNDim fSortOutNDim
Definition: G4KDMap.hh:86

Member Data Documentation

std::deque<G4KDNode_Base*> __1DSortOut::fContainer
protected

Definition at line 85 of file G4KDMap.hh.

sortOutNDim __1DSortOut::fSortOutNDim
protected

Definition at line 86 of file G4KDMap.hh.


The documentation for this class was generated from the following files: