BOSS 7.0.3
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//
22#include <iostream>
23#include <math.h>
25using std::ostream;
26
27
28ostream& operator<<(ostream& s, const EvtComplex& c){
29
30 s<<"("<<c._rpart<<","<<c._ipart<<")";
31 return s;
32
33}
34
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
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
ostream & operator<<(ostream &s, const EvtComplex &c)
Definition: EvtComplex.cc:28
XmlRpcServer s
Definition: HelloServer.cpp:11
EvtComplex & operator*=(double d)
Definition: EvtComplex.hh:131
EvtComplex & operator/=(double d)
Definition: EvtComplex.hh:141