BOSS
7.1.2
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 "
EvtGenBase/EvtPatches.hh
"
22
#include <iostream>
23
#include <math.h>
24
#include "
EvtGenBase/EvtComplex.hh
"
25
using
std::ostream;
26
27
28
ostream&
operator<<
(ostream&
s
,
const
EvtComplex
& c){
29
30
s
<<
"("
<<c._rpart<<
","
<<c._ipart<<
")"
;
31
return
s
;
32
33
}
34
35
EvtComplex
&
EvtComplex::operator*=
(
EvtComplex
c){
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
}
46
47
EvtComplex
&
EvtComplex::operator/=
(
EvtComplex
c){
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
}
60
61
62
63
operator<<
ostream & operator<<(ostream &s, const EvtComplex &c)
Definition
EvtComplex.cc:28
EvtComplex.hh
EvtPatches.hh
s
XmlRpcServer s
Definition
HelloServer.cpp:11
EvtComplex
Definition
EvtComplex.hh:28
EvtComplex::operator*=
EvtComplex & operator*=(double d)
Definition
EvtComplex.hh:131
EvtComplex::operator/=
EvtComplex & operator/=(double d)
Definition
EvtComplex.hh:141
7.1.2
Generator
BesEvtGen
BesEvtGen-00-04-30
src
EvtGen
EvtGenBase
EvtComplex.cc
Generated by
1.12.0