#include <EvtComplex.hh>
Definition at line 28 of file EvtComplex.hh.
◆ EvtComplex() [1/3]
| EvtComplex::EvtComplex |
( |
| ) |
|
|
inline |
Definition at line 49 of file EvtComplex.hh.
49: _rpart( 0.0 ), _ipart( 0.0 ) {}
Referenced by abs, abs2, arg, conj, EvtComplex(), exp, imag, operator!=(), operator*, operator*, operator*, operator*=(), operator*=(), operator+, operator+=(), operator+=(), operator-, operator-, operator-=(), operator-=(), operator/, operator/, operator/, operator/=(), operator/=(), operator<<, operator=(), operator==(), and real.
◆ 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 177 of file EvtComplex.hh.
177 {
178
179 return _rpart != c._rpart || _ipart != c._ipart;
180}
◆ operator*=() [1/2]
Definition at line 125 of file EvtComplex.hh.
125 {
126
127 _rpart *= d;
128 _ipart *= d;
129
130 return *this;
131}
◆ operator*=() [2/2]
Definition at line 33 of file EvtComplex.cc.
33 {
34
35 double r = _rpart * c._rpart - _ipart * c._ipart;
36 double i = _rpart * c._ipart + _ipart * c._rpart;
37
38 _rpart = r;
39 _ipart = i;
40
41 return *this;
42}
◆ operator+=() [1/2]
Definition at line 80 of file EvtComplex.hh.
80 {
81
82 _rpart += c._rpart;
83 _ipart += c._ipart;
84
85 return *this;
86}
◆ operator+=() [2/2]
Definition at line 96 of file EvtComplex.hh.
96 {
97
98 _rpart += d;
99
100 return *this;
101}
◆ operator-=() [1/2]
Definition at line 88 of file EvtComplex.hh.
88 {
89
90 _rpart -= c._rpart;
91 _ipart -= c._ipart;
92
93 return *this;
94}
◆ operator-=() [2/2]
Definition at line 103 of file EvtComplex.hh.
103 {
104
105 _rpart -= d;
106
107 return *this;
108}
◆ operator/=() [1/2]
Definition at line 133 of file EvtComplex.hh.
133 {
134
135 _rpart /= d;
136 _ipart /= d;
137
138 return *this;
139}
◆ operator/=() [2/2]
Definition at line 44 of file EvtComplex.cc.
44 {
45
46 double inv = 1.0 / ( c._rpart * c._rpart + c._ipart * c._ipart );
47
48 double r = inv * ( _rpart * c._rpart + _ipart * c._ipart );
49 double i = inv * ( _ipart * c._rpart - _rpart * c._ipart );
50
51 _rpart = r;
52 _ipart = i;
53
54 return *this;
55}
◆ operator=()
Definition at line 72 of file EvtComplex.hh.
72 {
73
74 _rpart = c._rpart;
75 _ipart = c._ipart;
76
77 return *this;
78}
◆ operator==()
Definition at line 172 of file EvtComplex.hh.
172 {
173
174 return _rpart == c._rpart && _ipart == c._ipart;
175}
◆ abs
Definition at line 186 of file EvtComplex.hh.
186 {
187
188 double c2 = c._rpart * c._rpart + c._ipart * c._ipart;
189 if ( c2 <= 0.0 ) return 0.0;
190 return sqrt( c2 );
191}
◆ abs2
Definition at line 193 of file EvtComplex.hh.
193{ return c._rpart * c._rpart + c._ipart * c._ipart; }
◆ arg
Definition at line 195 of file EvtComplex.hh.
195 {
196 if ( ( c._rpart == 0 ) && ( c._ipart == 0 ) ) { return 0.0; }
197 if ( c._rpart == 0 )
198 {
201 }
202 else { return atan2( c._ipart, c._rpart ); }
203}
◆ conj
◆ exp
Definition at line 209 of file EvtComplex.hh.
209 {
210
212}
double sin(const BesAngle a)
double cos(const BesAngle a)
friend EvtComplex exp(const EvtComplex &c)
◆ imag
◆ operator* [1/3]
◆ operator* [2/3]
Definition at line 156 of file EvtComplex.hh.
156 {
157
158 return EvtComplex( c1._rpart * c2._rpart - c1._ipart * c2._ipart,
159 c1._rpart * c2._ipart + c1._ipart * c2._rpart );
160}
◆ operator* [3/3]
◆ operator+
Definition at line 167 of file EvtComplex.hh.
167 {
168
169 return EvtComplex( c1._rpart + c2._rpart, c1._ipart + c2._ipart );
170}
◆ operator- [1/2]
◆ operator- [2/2]
Definition at line 162 of file EvtComplex.hh.
162 {
163
164 return EvtComplex( c1._rpart - c2._rpart, c1._ipart - c2._ipart );
165}
◆ operator/ [1/3]
◆ operator/ [2/3]
Definition at line 148 of file EvtComplex.hh.
148 {
149
150 double inv = 1.0 / ( c2._rpart * c2._rpart + c2._ipart * c2._ipart );
151
152 return EvtComplex( inv * ( c1._rpart * c2._rpart + c1._ipart * c2._ipart ),
153 inv * ( c1._ipart * c2._rpart - c1._rpart * c2._ipart ) );
154}
◆ operator/ [3/3]
Definition at line 141 of file EvtComplex.hh.
141 {
142
143 double Num = d / ( c._rpart * c._rpart + c._ipart * c._ipart );
144
145 return EvtComplex( Num * c._rpart, -Num * c._ipart );
146}
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | s, |
|
|
const EvtComplex & | c ) |
|
friend |
◆ real
The documentation for this class was generated from the following files: