#include <EvtAmpIndex.hh>
Definition at line 26 of file EvtAmpIndex.hh.
◆ EvtAmpIndex()
EvtAmpIndex::EvtAmpIndex |
( |
std::vector< int > |
ind | ) |
|
Definition at line 27 of file EvtAmpIndex.cc.
27 :
28 _ind(ind),
29 _size(ind.size()),
30 _state(ind.size()),
31 _nstate(ind.size())
32{
33 int i;
34
35 for(i=0;i<_size;i++) {
36 _state[i]=0;
37 if (i==0){
38 _nstate[i]=1;
39 }
40 else{
41 _nstate[i]=_nstate[i-1]*_ind[i];
42 }
43 }
44}
◆ ~EvtAmpIndex()
virtual EvtAmpIndex::~EvtAmpIndex |
( |
| ) |
|
|
inlinevirtual |
◆ index()
int EvtAmpIndex::index |
( |
| ) |
|
Definition at line 68 of file EvtAmpIndex.cc.
68 {
69
70 int i;
71 int ind=0;
72
73 for(i=0;i<_size;i++) {
74 ind+=_state[i]*_nstate[i];
75 }
76
77 return ind;
78
79}
◆ next()
bool EvtAmpIndex::next |
( |
| ) |
|
Definition at line 54 of file EvtAmpIndex.cc.
54 {
55 int i;
56 for(i=0;i<_size;i++) {
57 _state[i]++;
58 if (_state[i]<_ind[i]){
59 return true;
60 }
61 else{
62 _state[i]=0;
63 }
64 }
65 return false;
66}
◆ reset()
void EvtAmpIndex::reset |
( |
| ) |
|
Definition at line 47 of file EvtAmpIndex.cc.
47 {
48 int i;
49 for(i=0;i<_size;i++) {
50 _state[i]=0;
51 }
52}
◆ EvtAmpSubIndex
The documentation for this class was generated from the following files: