BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtComplex.cc
Go to the documentation of this file.
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: EvtComplex.cc
12
//
13
// Description: EvtComlex.cc
14
//
15
// Modification history:
16
//
17
// RYD December 5, 1998 Created
18
//
19
//------------------------------------------------------------------------
20
//
21
#include "
EvtComplex.hh
"
22
#include "
EvtPatches.hh
"
23
#include <iostream>
24
#include <math.h>
25
using
std::ostream;
26
27
ostream&
operator<<
( ostream&
s
,
const
EvtComplex
& c ) {
28
29
s
<<
"("
<< c._rpart <<
","
<< c._ipart <<
")"
;
30
return
s
;
31
}
32
33
EvtComplex
&
EvtComplex::operator*=
(
EvtComplex
c ) {
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
}
43
44
EvtComplex
&
EvtComplex::operator/=
(
EvtComplex
c ) {
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<<
ostream & operator<<(ostream &s, const EvtComplex &c)
Definition
EvtComplex.cc:27
EvtComplex.hh
EvtPatches.hh
s
XmlRpcServer s
Definition
HelloServer.cpp:11
EvtComplex
Definition
EvtComplex.hh:28
EvtComplex::EvtComplex
EvtComplex()
Definition
EvtComplex.hh:49
EvtComplex::operator*=
EvtComplex & operator*=(double d)
Definition
EvtComplex.hh:125
EvtComplex::operator/=
EvtComplex & operator/=(double d)
Definition
EvtComplex.hh:133
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenBase
EvtComplex.cc
Generated by
1.16.1