MatchTaskSort< SORTER > Class Template Reference

#include <MatchStore.h>

Inheritance diagram for MatchTaskSort< SORTER >:

Inheritance graph
[legend]
Collaboration diagram for MatchTaskSort< SORTER >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MatchTaskSort (unsigned int maxToSort=1<< 30, double partialThreshold=0.0)
void operator() (MatchStore &store)

Private Attributes

unsigned int maxToSort_
double partialThreshold_
SORTER sorter_

Detailed Description

template<class SORTER>
class MatchTaskSort< SORTER >

Definition at line 440 of file MatchStore.h.


Constructor & Destructor Documentation

template<class SORTER>
MatchTaskSort< SORTER >::MatchTaskSort (  )  [inline]

Definition at line 444 of file MatchStore.h.

00447     : sorter_(), maxToSort_(maxToSort), partialThreshold_(partialThreshold) {}


Member Function Documentation

template<class SORTER>
void MatchTaskSort< SORTER >::operator() ( MatchStore store  )  [inline, virtual]

Implements MatchTask.

Definition at line 449 of file MatchStore.h.

References MatchTaskSort< SORTER >::maxToSort_, MatchTaskSort< SORTER >::partialThreshold_, and MatchTaskSort< SORTER >::sorter_.

00450   {
00451     if (    ( store.size() <= maxToSort_)
00452          || (  ((double)maxToSort_) / ((double)store.size())
00453                > partialThreshold_  )  )
00454       sort( store.begin(), store.end(), sorter_ );
00455     else 
00456     {
00457       partial_sort( store.begin(), 
00458                     store.begin()+maxToSort_, 
00459                     store.end(), 
00460                     sorter_ );
00461     }
00462     store.resize(min((unsigned int)store.size(),maxToSort_));
00463   }


Member Data Documentation

template<class SORTER>
unsigned int MatchTaskSort< SORTER >::maxToSort_ [private]

Definition at line 465 of file MatchStore.h.

Referenced by MatchTaskSort< SORTER >::operator()().

template<class SORTER>
double MatchTaskSort< SORTER >::partialThreshold_ [private]

Definition at line 466 of file MatchStore.h.

Referenced by MatchTaskSort< SORTER >::operator()().

template<class SORTER>
SORTER MatchTaskSort< SORTER >::sorter_ [private]

Definition at line 467 of file MatchStore.h.

Referenced by MatchTaskSort< SORTER >::operator()().


The documentation for this class was generated from the following file:
Generated on Fri Dec 21 13:19:07 2007 for ssaha by  doxygen 1.5.2