Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtAmpIndex Class Reference

#include <EvtAmpIndex.hh>

List of all members.

Public Member Functions

 EvtAmpIndex (std::vector< int > ind)
int index ()
bool next ()
void reset ()
virtual ~EvtAmpIndex ()

Private Attributes

std::vector< int > _ind
std::vector< int > _nstate
int _size
std::vector< int > _state

Friends

class EvtAmpSubIndex


Constructor & Destructor Documentation

EvtAmpIndex::EvtAmpIndex std::vector< int >  ind  ) 
 

00027                                           :
00028   _ind(ind),
00029   _size(ind.size()),
00030   _state(ind.size()),
00031   _nstate(ind.size())
00032 {
00033   int i;
00034   
00035   for(i=0;i<_size;i++) {
00036     _state[i]=0;
00037     if (i==0){
00038       _nstate[i]=1;
00039     }
00040     else{
00041       _nstate[i]=_nstate[i-1]*_ind[i];
00042     }
00043   }
00044 }

virtual EvtAmpIndex::~EvtAmpIndex  )  [inline, virtual]
 

00033 {}


Member Function Documentation

int EvtAmpIndex::index  ) 
 

00068                       {
00069 
00070   int i;
00071   int ind=0;
00072 
00073   for(i=0;i<_size;i++) {
00074     ind+=_state[i]*_nstate[i];
00075   }
00076 
00077   return ind;
00078 
00079 }

bool EvtAmpIndex::next  ) 
 

00054                       {
00055   int i;
00056   for(i=0;i<_size;i++) {
00057     _state[i]++;
00058     if (_state[i]<_ind[i]){
00059       return true;
00060     }
00061     else{
00062       _state[i]=0;
00063     }
00064   }
00065   return false;
00066 }

void EvtAmpIndex::reset  ) 
 

00047                        {
00048   int i;
00049   for(i=0;i<_size;i++) {
00050     _state[i]=0;
00051   }
00052 }


Friends And Related Function Documentation

friend class EvtAmpSubIndex [friend]
 


Member Data Documentation

std::vector<int> EvtAmpIndex::_ind [private]
 

std::vector<int> EvtAmpIndex::_nstate [private]
 

int EvtAmpIndex::_size [private]
 

std::vector<int> EvtAmpIndex::_state [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:03:10 2011 for BOSS6.5.5 by  doxygen 1.3.9.1