ThePEG  1.8.0
Complex.h
1 // -*- C++ -*-
2 //
3 // Complex.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_Complex_H
10 #define ThePEG_Complex_H
11 //
12 // This is file wraps the standard complex header and makes some
13 // convenient typedefs in the ThePEG namespace.
14 //
15 
16 #include <complex>
17 
18 namespace ThePEG {
19 
20 using std::complex;
21 
23 typedef std::complex<double> Complex;
24 
27 template <typename T, typename U>
28 struct BinaryOpTraits;
29 
30 
31 template <typename T, typename U>
32 struct BinaryOpTraits<complex<T>, U> {
35  typedef complex<typename BinaryOpTraits<T,U>::MulT> MulT;
38  typedef complex<typename BinaryOpTraits<T,U>::DivT> DivT;
39 
40 };
41 
42 template <typename T, typename U>
43 struct BinaryOpTraits<T, complex<U> > {
46  typedef complex<typename BinaryOpTraits<T,U>::MulT> MulT;
49  typedef complex<typename BinaryOpTraits<T,U>::DivT> DivT;
50 
51 };
52 
53 template <typename T, typename U>
54 struct BinaryOpTraits<complex<T>, complex<U> > {
57  typedef complex<typename BinaryOpTraits<T,U>::MulT> MulT;
60  typedef complex<typename BinaryOpTraits<T,U>::DivT> DivT;
61 
62 };
63 
64 template <typename T>
65 struct BinaryOpTraits<complex<T>, complex<T> > {
68  typedef complex<typename BinaryOpTraits<T,T>::MulT> MulT;
71  typedef complex<typename BinaryOpTraits<T,T>::DivT> DivT;
72 
75 };
76 
77 
78 
79 }
80 
81 #endif /* ThePEG_Complex_H */
82 
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition: Complex.h:23
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
BinaryOpTraits should be specialized with typdefs called MulT and DivT which gives the type resulting...
Definition: PhysicalQty.h:239