EvtAmpIndex Class Reference

#include <EvtAmpIndex.hh>

List of all members.

Public Member Functions

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

Private Attributes

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

Friends

class EvtAmpSubIndex


Detailed Description

Definition at line 26 of file EvtAmpIndex.hh.


Constructor & Destructor Documentation

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

Definition at line 27 of file EvtAmpIndex.cc.

References _ind, _nstate, _size, _state, and genRecEmupikp::i.

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]

Definition at line 33 of file EvtAmpIndex.hh.

00033 {}


Member Function Documentation

int EvtAmpIndex::index (  ) 

Definition at line 68 of file EvtAmpIndex.cc.

References _nstate, _size, _state, and genRecEmupikp::i.

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 (  ) 

Definition at line 54 of file EvtAmpIndex.cc.

References _ind, _size, _state, and genRecEmupikp::i.

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 (  ) 

Definition at line 47 of file EvtAmpIndex.cc.

References _size, _state, and genRecEmupikp::i.

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]

Definition at line 28 of file EvtAmpIndex.hh.


Member Data Documentation

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

Definition at line 42 of file EvtAmpIndex.hh.

Referenced by EvtAmpIndex(), EvtAmpSubIndex::EvtAmpSubIndex(), EvtAmpSubIndex::index(), and next().

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

Definition at line 45 of file EvtAmpIndex.hh.

Referenced by EvtAmpIndex(), and index().

int EvtAmpIndex::_size [private]

Definition at line 43 of file EvtAmpIndex.hh.

Referenced by EvtAmpIndex(), index(), next(), and reset().

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

Definition at line 44 of file EvtAmpIndex.hh.

Referenced by EvtAmpIndex(), EvtAmpSubIndex::index(), index(), next(), and reset().


Generated on Tue Nov 29 23:18:51 2016 for BOSS_7.0.2 by  doxygen 1.4.7