Line data Source code
1 : //--------------------------------------------------------------------------
2 : //
3 : // Environment:
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.
7 : //
8 : // Copyright Information: See EvtGen/COPYRIGHT
9 : // Copyright (C) 1998 Caltech, UCSB
10 : //
11 : // Module: EvtGen/Evt3Rank3C.hh
12 : //
13 : // Description:Class to handle complex 3rd rank 3D tensors
14 : //
15 : // Modification history:
16 : //
17 : // RYD September 14, 1997 Module created
18 : //
19 : //------------------------------------------------------------------------
20 :
21 : #ifndef EVT3RANK3C_HH
22 : #define EVT3RANK3C_HH
23 :
24 : #include <iostream>
25 : #include "EvtGenBase/EvtComplex.hh"
26 :
27 : class EvtTensor3C;
28 : class EvtVector3C;
29 : class EvtVector3R;
30 :
31 :
32 : class Evt3Rank3C ;
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);
42 :
43 :
44 : class Evt3Rank3C {
45 :
46 : friend Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2);
47 : friend Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2);
48 : friend Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c);
49 : friend Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d);
50 : friend Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
51 : friend Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2);
52 : friend Evt3Rank3C directProd(const EvtVector3C& c1,const EvtVector3C& c2,
53 : const EvtVector3C& c3);
54 : friend Evt3Rank3C conj(const Evt3Rank3C& t2);
55 :
56 : friend std::ostream& operator<<(std::ostream& s, const Evt3Rank3C& t2);
57 :
58 : public:
59 : Evt3Rank3C();
60 : Evt3Rank3C(const Evt3Rank3C& t1 );
61 : virtual ~Evt3Rank3C();
62 : Evt3Rank3C& operator=(const Evt3Rank3C& t1);
63 : inline void set(int i,int j,int k,const EvtComplex& c);
64 : inline const EvtComplex& get(int i, int j, int k) const;
65 : void zero();
66 :
67 :
68 : Evt3Rank3C& operator+=(const Evt3Rank3C& t2);
69 : Evt3Rank3C& operator-=(const Evt3Rank3C& t2);
70 : Evt3Rank3C& operator*=(const double d);
71 : Evt3Rank3C& operator*=(const EvtComplex& c);
72 : Evt3Rank3C conj() const;
73 : EvtTensor3C cont1(const EvtVector3C& v) const;
74 : EvtTensor3C cont2(const EvtVector3C& v) const;
75 : EvtTensor3C cont3(const EvtVector3C& v) const;
76 : EvtTensor3C cont1(const EvtVector3R& v) const;
77 : EvtTensor3C cont2(const EvtVector3R& v) const;
78 : EvtTensor3C cont3(const EvtVector3R& v) const;
79 :
80 :
81 : private:
82 :
83 : EvtComplex t[3][3][3];
84 :
85 : };
86 :
87 :
88 : inline Evt3Rank3C operator*(const EvtComplex& c,const Evt3Rank3C& t2){
89 : return Evt3Rank3C(t2)*=c;
90 : }
91 :
92 : inline Evt3Rank3C operator*(const double d,const Evt3Rank3C& t2){
93 : return Evt3Rank3C(t2)*=d;
94 : }
95 :
96 : inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const EvtComplex& c){
97 : return Evt3Rank3C(t2)*=c;
98 : }
99 :
100 : inline Evt3Rank3C operator*(const Evt3Rank3C& t2,const double d){
101 : return Evt3Rank3C(t2)*=d;
102 : }
103 :
104 : inline Evt3Rank3C operator+(const Evt3Rank3C& t1,const Evt3Rank3C& t2){
105 : return Evt3Rank3C(t1)+=t2;
106 : }
107 :
108 : inline Evt3Rank3C operator-(const Evt3Rank3C& t1,const Evt3Rank3C& t2){
109 : return Evt3Rank3C(t1)-=t2;
110 : }
111 :
112 : inline void Evt3Rank3C::set(int i,int j,int k,const EvtComplex& c){
113 0 : t[i][j][k]=c;
114 0 : }
115 :
116 : inline const EvtComplex& Evt3Rank3C::get(int i,int j,int k) const{
117 : return t[i][j][k];
118 : }
119 :
120 :
121 : #endif
122 :
123 :
|