#include <EvtAmpIndex.hh>
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 |
Definition at line 26 of file EvtAmpIndex.hh.
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] |
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 | ( | ) |
void EvtAmpIndex::reset | ( | ) |
friend class EvtAmpSubIndex [friend] |
Definition at line 28 of file EvtAmpIndex.hh.
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] |
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().