CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
AccumulatingSort< T > Class Template Reference

#include <AccumulatingSort.h>

Public Member Functions

 AccumulatingSort (const uint32_t &aSize)
 
void Merge (const std::vector< T > &aInput, std::vector< T > &aOutput)
 

Private Member Functions

void AccumulatorUnit (const std::list< T > &aInput, T &aAcc, std::list< T > &aTail)
 

Private Attributes

uint32_t mSize
 
std::vector< std::list< T > > mSortArrays
 

Detailed Description

template<typename T>
class AccumulatingSort< T >

Definition at line 6 of file AccumulatingSort.h.

Constructor & Destructor Documentation

◆ AccumulatingSort()

template<typename T>
AccumulatingSort< T >::AccumulatingSort ( const uint32_t &  aSize)
inline

Definition at line 33 of file AccumulatingSort.h.

33 : mSortArrays(aSize + 1, std::list<T>(aSize)), mSize(aSize) {}

Member Function Documentation

◆ AccumulatorUnit()

template<typename T>
void AccumulatingSort< T >::AccumulatorUnit ( const std::list< T > &  aInput,
T aAcc,
std::list< T > &  aTail 
)
inlineprivate

Definition at line 12 of file AccumulatingSort.h.

12  {
13  aTail.clear();
14 
15  bool lAccInserted(false);
16 
17  for (typename std::list<T>::const_iterator lIt(aInput.begin()); lIt != aInput.end(); ++lIt) {
18  if (!lAccInserted and
19  !(*lIt >
20  aAcc)) // Accumulator greater than or equal to new entry and not previously inserted -> Reinsert accumulator
21  {
22  aTail.push_back(aAcc);
23  lAccInserted = true;
24  }
25  aTail.push_back(*lIt);
26  }
27 
28  aAcc = *aTail.begin();
29  aTail.erase(aTail.begin());
30  }

Referenced by AccumulatingSort< T >::Merge().

◆ Merge()

template<typename T>
void AccumulatingSort< T >::Merge ( const std::vector< T > &  aInput,
std::vector< T > &  aOutput 
)
inline

Member Data Documentation

◆ mSize

template<typename T>
uint32_t AccumulatingSort< T >::mSize
private

Definition at line 9 of file AccumulatingSort.h.

Referenced by AccumulatingSort< T >::Merge().

◆ mSortArrays

template<typename T>
std::vector<std::list<T> > AccumulatingSort< T >::mSortArrays
private

Definition at line 8 of file AccumulatingSort.h.

Referenced by AccumulatingSort< T >::Merge().

mps_fire.i
i
Definition: mps_fire.py:355
AccumulatingSort::mSize
uint32_t mSize
Definition: AccumulatingSort.h:9
AccumulatingSort::AccumulatorUnit
void AccumulatorUnit(const std::list< T > &aInput, T &aAcc, std::list< T > &aTail)
Definition: AccumulatingSort.h:12
AccumulatingSort::mSortArrays
std::vector< std::list< T > > mSortArrays
Definition: AccumulatingSort.h:8
begin
#define begin
Definition: vmac.h:32