#include <EvtComplex.hh>
Definition at line 28 of file EvtComplex.hh.
◆ EvtComplex() [1/3]
EvtComplex::EvtComplex |
( |
| ) |
|
|
inline |
◆ EvtComplex() [2/3]
EvtComplex::EvtComplex |
( |
double | rpart, |
|
|
double | ipart = 0.0 ) |
|
inline |
Definition at line 50 of file EvtComplex.hh.
50:_rpart(rpart),_ipart(ipart){}
◆ EvtComplex() [3/3]
Definition at line 51 of file EvtComplex.hh.
51:_rpart(c._rpart),_ipart(c._ipart){}
◆ operator!=()
Definition at line 193 of file EvtComplex.hh.
193 {
194
195 return _rpart!=c._rpart||_ipart!=c._ipart;
196
197}
◆ operator*=() [1/2]
Definition at line 131 of file EvtComplex.hh.
131 {
132
133 _rpart*=d;
134 _ipart*=d;
135
136 return *this;
137
138}
◆ operator*=() [2/2]
Definition at line 35 of file EvtComplex.cc.
35 {
36
37 double r=_rpart*c._rpart-_ipart*c._ipart;
38 double i=_rpart*c._ipart+_ipart*c._rpart;
39
40 _rpart=r;
41 _ipart=i;
42
43 return *this;
44
45}
◆ operator+=() [1/2]
Definition at line 81 of file EvtComplex.hh.
81 {
82
83 _rpart+=c._rpart;
84 _ipart+=c._ipart;
85
86 return *this;
87}
◆ operator+=() [2/2]
Definition at line 97 of file EvtComplex.hh.
97 {
98
99 _rpart+=d;
100
101 return *this;
102}
◆ operator-=() [1/2]
Definition at line 89 of file EvtComplex.hh.
89 {
90
91 _rpart-=c._rpart;
92 _ipart-=c._ipart;
93
94 return *this;
95}
◆ operator-=() [2/2]
Definition at line 104 of file EvtComplex.hh.
104 {
105
106 _rpart-=d;
107
108 return *this;
109}
◆ operator/=() [1/2]
Definition at line 141 of file EvtComplex.hh.
141 {
142
143 _rpart/=d;
144 _ipart/=d;
145
146 return *this;
147}
◆ operator/=() [2/2]
Definition at line 47 of file EvtComplex.cc.
47 {
48
49 double inv=1.0/(c._rpart*c._rpart+c._ipart*c._ipart);
50
51 double r=inv*(_rpart*c._rpart+_ipart*c._ipart);
52 double i=inv*(_ipart*c._rpart-_rpart*c._ipart);
53
54 _rpart=r;
55 _ipart=i;
56
57 return *this;
58
59}
◆ operator=()
Definition at line 73 of file EvtComplex.hh.
73 {
74
75 _rpart=c._rpart;
76 _ipart=c._ipart;
77
78 return *this;
79}
◆ operator==()
Definition at line 187 of file EvtComplex.hh.
187 {
188
189 return _rpart==c._rpart&&_ipart==c._ipart;
190
191}
◆ abs
Definition at line 212 of file EvtComplex.hh.
212 {
213
214 double c2=c._rpart*c._rpart+c._ipart*c._ipart;
215 if (c2<=0.0) return 0.0;
216 return sqrt(c2);
217
218}
◆ abs2
Definition at line 221 of file EvtComplex.hh.
221 {
222
223 return c._rpart*c._rpart+c._ipart*c._ipart;
224}
◆ arg
Definition at line 227 of file EvtComplex.hh.
227 {
228 if ((c._rpart==0)&&(c._ipart==0)) {return 0.0;}
229 if (c._rpart==0){
230 if (c._ipart>0){
232 } else {
234 }
235 } else {
236 return atan2(c._ipart,c._rpart);
237 }
238}
◆ conj
◆ exp
Definition at line 252 of file EvtComplex.hh.
252 {
253
255
256}
double sin(const BesAngle a)
double cos(const BesAngle a)
friend EvtComplex exp(const EvtComplex &c)
◆ imag
Definition at line 246 of file EvtComplex.hh.
246 {
247
248 return c._ipart;
249
250}
◆ operator* [1/3]
◆ operator* [2/3]
Definition at line 168 of file EvtComplex.hh.
168 {
169
170 return EvtComplex(c1._rpart*c2._rpart-c1._ipart*c2._ipart,
171 c1._rpart*c2._ipart+c1._ipart*c2._rpart);
172
173}
◆ operator* [3/3]
◆ operator+
◆ operator- [1/2]
◆ operator- [2/2]
◆ operator/ [1/3]
◆ operator/ [2/3]
Definition at line 159 of file EvtComplex.hh.
159 {
160
161 double inv=1.0/(c2._rpart*c2._rpart+c2._ipart*c2._ipart);
162
163 return EvtComplex(inv*(c1._rpart*c2._rpart+c1._ipart*c2._ipart),
164 inv*(c1._ipart*c2._rpart-c1._rpart*c2._ipart));
165
166}
◆ operator/ [3/3]
Definition at line 149 of file EvtComplex.hh.
149 {
150
151double Num=d/(c._rpart*c._rpart+c._ipart*c._ipart);
152
153return EvtComplex( Num*c._rpart, -Num*c._ipart );
154
155}
◆ operator<<
std::ostream & operator<< |
( |
std::ostream & | s, |
|
|
const EvtComplex & | c ) |
|
friend |
◆ real
Definition at line 240 of file EvtComplex.hh.
240 {
241
242 return c._rpart;
243
244}
The documentation for this class was generated from the following files: