CMS 3D CMS Logo

Public Types | Public Member Functions | Private Types | Private Attributes

reco::tau::CombinatoricGenerator< T > Class Template Reference

#include <CombinatoricGenerator.h>

List of all members.

Public Types

typedef std::auto_ptr
< CombinatoricIterator< T > > 
CombIterPtr
typedef
iterator::value_type::ValueIter 
combo_iterator
typedef CombinatoricIterator< Titerator

Public Member Functions

CombinatoricIterator< Tbegin ()
 CombinatoricGenerator (const value_iter &begin, const value_iter &end, size_t choose)
CombinatoricIterator< Tend ()

Private Types

typedef
indices_collection::iterator 
index_iter
typedef size_t index_type
typedef std::vector< index_typeindices_collection
typedef std::set< index_typeindices_set
typedef T::const_iterator value_iter
typedef T::value_type value_type

Private Attributes

CombIterPtr beginning_
CombIterPtr ending_

Detailed Description

template<typename T>
class reco::tau::CombinatoricGenerator< T >

Definition at line 238 of file CombinatoricGenerator.h.


Member Typedef Documentation

template<typename T >
typedef std::auto_ptr<CombinatoricIterator<T> > reco::tau::CombinatoricGenerator< T >::CombIterPtr

Definition at line 259 of file CombinatoricGenerator.h.

Definition at line 261 of file CombinatoricGenerator.h.

template<typename T >
typedef indices_collection::iterator reco::tau::CombinatoricGenerator< T >::index_iter [private]

Definition at line 254 of file CombinatoricGenerator.h.

template<typename T >
typedef size_t reco::tau::CombinatoricGenerator< T >::index_type [private]

Definition at line 252 of file CombinatoricGenerator.h.

template<typename T >
typedef std::vector<index_type> reco::tau::CombinatoricGenerator< T >::indices_collection [private]

Definition at line 253 of file CombinatoricGenerator.h.

template<typename T >
typedef std::set<index_type> reco::tau::CombinatoricGenerator< T >::indices_set [private]

Definition at line 255 of file CombinatoricGenerator.h.

Definition at line 260 of file CombinatoricGenerator.h.

template<typename T >
typedef T::const_iterator reco::tau::CombinatoricGenerator< T >::value_iter [private]

Definition at line 250 of file CombinatoricGenerator.h.

template<typename T >
typedef T::value_type reco::tau::CombinatoricGenerator< T >::value_type [private]

Definition at line 251 of file CombinatoricGenerator.h.


Constructor & Destructor Documentation

template<typename T >
reco::tau::CombinatoricGenerator< T >::CombinatoricGenerator ( const value_iter begin,
const value_iter end,
size_t  choose 
) [inline, explicit]

Definition at line 263 of file CombinatoricGenerator.h.

References reco::tau::CombinatoricGenerator< T >::begin(), reco::tau::CombinatoricGenerator< T >::beginning_, reco::tau::CombinatoricGenerator< T >::ending_, and i.

    {
      // Make beginning and ending index collections
      indices_collection initialCombo(choose);
      indices_collection finalCombo(choose);

      size_t totalElements = end-begin;

      indices_collection allIndices(totalElements);
      for(size_t i=0; i < totalElements; ++i)
      {
        allIndices[i] = i;
      }

      for(size_t i=0; i < choose; ++i)
      {
        initialCombo[i] = i;
        // End conditions each is set at nElements
        finalCombo[i] = totalElements;
      }

      beginning_ = CombIterPtr(new CombinatoricIterator<T>(Combinatoric<T>(
              begin, allIndices, initialCombo, false)));

      ending_ = CombIterPtr(new CombinatoricIterator<T>(Combinatoric<T>(
              begin, allIndices, finalCombo, true)));
    }

Member Function Documentation

template<typename T >
CombinatoricIterator<T> reco::tau::CombinatoricGenerator< T >::begin ( void  ) [inline]
template<typename T >
CombinatoricIterator<T> reco::tau::CombinatoricGenerator< T >::end ( void  ) [inline]

Definition at line 295 of file CombinatoricGenerator.h.

References reco::tau::CombinatoricGenerator< T >::ending_.

                                  {
      return *ending_;
    }

Member Data Documentation

template<typename T >
CombIterPtr reco::tau::CombinatoricGenerator< T >::beginning_ [private]
template<typename T >
CombIterPtr reco::tau::CombinatoricGenerator< T >::ending_ [private]