1 //--------------------------------------------------------------------------
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
11 // Module: EvtGen/Evt3Rank3C.hh
13 // Description:Class to handle complex 3rd rank 3D tensors
15 // Modification history:
17 // RYD September 14, 1997 Module created
19 //------------------------------------------------------------------------
25 #include "EvtGenBase/EvtComplex.hh"
33 inline Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2);
34 inline Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2);
35 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c);
36 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d);
37 inline Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
38 inline Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
39 Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
40 const EvtVector3C& c3);
41 Evt3Rank3C conj(const Evt3Rank3C& t2);
43 Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
44 const EvtVector3C& c3);
49 friend Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2);
50 friend Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2);
51 friend Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c);
52 friend Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d);
53 friend Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
54 friend Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
55 friend Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
56 const EvtVector3C& c3);
57 friend Evt3Rank3C conj(const Evt3Rank3C& t2);
59 friend std::ostream& operator<<(std::ostream& s, const Evt3Rank3C& t2);
63 Evt3Rank3C(const Evt3Rank3C& t1 );
64 virtual ~Evt3Rank3C();
65 Evt3Rank3C& operator=(const Evt3Rank3C& t1);
66 inline void set(int i,int j,int k,const EvtComplex& c);
67 inline const EvtComplex& get(int i, int j, int k) const;
71 Evt3Rank3C& operator+=(const Evt3Rank3C& t2);
72 Evt3Rank3C& operator-=(const Evt3Rank3C& t2);
73 Evt3Rank3C& operator*=(const double d);
74 Evt3Rank3C& operator*=(const EvtComplex& c);
75 Evt3Rank3C conj() const;
76 EvtTensor3C cont1(const EvtVector3C& v) const;
77 EvtTensor3C cont2(const EvtVector3C& v) const;
78 EvtTensor3C cont3(const EvtVector3C& v) const;
79 EvtTensor3C cont1(const EvtVector3R& v) const;
80 EvtTensor3C cont2(const EvtVector3R& v) const;
81 EvtTensor3C cont3(const EvtVector3R& v) const;
86 EvtComplex t[3][3][3];
91 inline Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2){
92 return Evt3Rank3C(t2)*=c;
95 inline Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2){
96 return Evt3Rank3C(t2)*=d;
99 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c){
100 return Evt3Rank3C(t2)*=c;
103 inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d){
104 return Evt3Rank3C(t2)*=d;
107 inline Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2){
108 return Evt3Rank3C(t1)+=t2;
111 inline Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2){
112 return Evt3Rank3C(t1)-=t2;
115 inline void Evt3Rank3C::set(int i,int j,int k,const EvtComplex& c){
119 inline const EvtComplex& Evt3Rank3C::get(int i,int j,int k) const{