colorfull is hosted by Hepforge, IPPP Durham
ColorFull  1.1
/data/Documents/eclipse/workspace/ColorFull/Monomial.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /*
3  * Monomial.h
4  * Contains declaration of the class Monomial and associated types and operators
5  * Created on: Jul 7, 2010
6  * Author: Malin Sjodahl
7  */
8 
9 #ifndef COLORFULL_Monomial_h
10 #define COLORFULL_Monomial_h
11 
12 #include "types.h"
13 
14 
15 namespace ColorFull {
16 
17 
23 class Monomial {
24 public:
25 
29  int_part=1;
30  cnum_part=1.0;
31  }
32 
35  Monomial( double dnum ){
37  int_part=1;
38  cnum_part.real(dnum);
39  }
40 
43  Monomial( int num ){
45  int_part=num;
46  cnum_part=1.0;
47  }
48 
62  Monomial( std::string str );
63 
65  int pow_TR;
66 
68  int pow_Nc;
69 
71  int pow_CF;
72 
74  int int_part;
75 
78 
81  void conjugate() {
82  cnum_part=conj( cnum_part );
83  }
84 
87  void read_in_Monomial( std::string filename );
88 
89 
92  void write_out_Monomial( std::string filename ) const;
93 
94 
95 private:
96 
109  void Monomial_of_str( std::string str );
110 
111 
112 };
113 
114 
116 std::ostream& operator<<( std::ostream& out, const Monomial & Mon );
117 
121 Monomial operator*( const Monomial & Mon, const int i );
122 
125 Monomial operator*( const int i, const Monomial & Mon );
126 
130 Monomial operator*( const Monomial & Mon, const cnum c );
131 
133 Monomial operator*( const cnum c, const Monomial & Mon );
134 
138 Monomial operator*( const Monomial & Mon, const double d );
139 
141 Monomial operator*( const double d, const Monomial & Mon );
142 
146 Monomial operator*( const Monomial & Mon1, const Monomial & Mon2 );
147 
151 Monomial operator*=( Monomial & Mon, const int i );
152 
156 Monomial operator*=( Monomial & Mon, const cnum c );
157 
161 Monomial operator*=( Monomial & Mon, const double d );
162 
165 Monomial operator*=( Monomial & Mon1, const Monomial & Mon2);
166 
169 bool operator==( const Monomial & Mon1, const Monomial & Mon2 );
170 
173 bool operator!=( const Monomial & Mon1, const Monomial & Mon2 );
174 
181 bool operator<( const Monomial & Mon1, const Monomial & Mon2 );
182 
183 }
184 
185 #endif /* COLORFULL_Monomial_h */
int int_part
Integer multiplying the monomial, can be 0.
Definition: Monomial.h:74
void write_out_Monomial(std::string filename) const
bool operator<(const Monomial &Mon1, const Monomial &Mon2)
Col_amp operator*(const Col_amp &Ca, const int i)
Define the operator * for Col_amps and integers.
bool operator==(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator == for two Col_amps.
Monomial(int num)
Definition: Monomial.h:43
int pow_TR
Power of TR in Monomial.
Definition: Monomial.h:65
int pow_CF
Power of CF=TR (Nc^2-1)/Nc.
Definition: Monomial.h:71
Definition: Col_amp.h:15
std::ostream & operator<<(std::ostream &out, const col_amp &ca)
Define the operator << for col_amp.
Monomial()
Default constructor sets int_part=cnum_part=1, and pow_Nc=pow_TR=pow_CF=0.
Definition: Monomial.h:27
std::complex< double > cnum
A complex number, needed as amplitudes in general are complex.
Definition: types.h:20
Definition: Monomial.h:23
Col_amp operator*=(Col_amp &Ca1, const Col_amp &Ca2)
Define the operator *= for two Col_amps.
void read_in_Monomial(std::string filename)
bool operator!=(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator != for two Col_amps.
int pow_Nc
Power of the number of colors.
Definition: Monomial.h:68
Monomial(double dnum)
Definition: Monomial.h:35
cnum cnum_part
Complex number multiplying the monomial.
Definition: Monomial.h:77
void conjugate()
Definition: Monomial.h:81