1 #ifndef __EVTSPINAMP_HH__
2 #define __EVTSPINAMP_HH__
4 #include "EvtGenBase/EvtSpinType.hh"
5 #include "EvtGenBase/EvtComplex.hh"
23 friend std::ostream& operator<< ( std::ostream&,
const EvtSpinAmp& );
28 EvtSpinAmp(
const vector<EvtSpinType::spintype>& );
30 EvtSpinAmp(
const vector<EvtSpinType::spintype>& ,
const vector<EvtComplex>& );
37 const EvtComplex& operator()(
const vector<int>& )
const;
39 const EvtComplex& operator()(
int, ... )
const;
57 void intcont(
size_t,
size_t );
61 void assign(
const EvtComplex & val ) { _elem.assign( _elem.size(), val ); }
64 size_t rank( )
const {
return _twospin.size(); }
67 const vector<unsigned int> & dims( )
const {
return _twospin; }
71 void addspin(
int twospin ) { _twospin.push_back( twospin ); }
72 void setelem(
const vector<EvtComplex> &
elem ) { _elem = elem; }
74 bool iterate( vector<int>& index )
const;
75 vector<int> iterinit()
const;
77 bool allowed(
const vector<int>& index )
const;
78 bool iterateallowed( vector<int>& index)
const;
79 vector<int> iterallowedinit()
const;
83 void checkindexargs(
const vector<int>& index )
const;
84 void checktwospin(
const vector<unsigned int>& twospin )
const;
85 int findtrueindex(
const vector<int>& index )
const;
86 vector<unsigned int> calctwospin(
const vector<EvtSpinType::spintype>& type )
const;
88 vector<EvtSpinType::spintype> _type;
89 vector<unsigned int> _twospin;
90 vector<EvtComplex> _elem;
93 #endif // __EVTSPINAMP__