herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Monomial.h
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
15namespace ColorFull {
16
17
23class Monomial {
24public:
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
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
95private:
96
109 void Monomial_of_str( std::string str );
110
111
112};
113
114
116std::ostream& operator<<( std::ostream& out, const Monomial & Mon );
117
121Monomial operator*( const Monomial & Mon, const int i );
122
125Monomial operator*( const int i, const Monomial & Mon );
126
130Monomial operator*( const Monomial & Mon, const cnum c );
131
133Monomial operator*( const cnum c, const Monomial & Mon );
134
138Monomial operator*( const Monomial & Mon, const double d );
139
141Monomial operator*( const double d, const Monomial & Mon );
142
146Monomial operator*( const Monomial & Mon1, const Monomial & Mon2 );
147
151Monomial operator*=( Monomial & Mon, const int i );
152
156Monomial operator*=( Monomial & Mon, const cnum c );
157
161Monomial operator*=( Monomial & Mon, const double d );
162
165Monomial operator*=( Monomial & Mon1, const Monomial & Mon2);
166
169bool operator==( const Monomial & Mon1, const Monomial & Mon2 );
170
173bool operator!=( const Monomial & Mon1, const Monomial & Mon2 );
174
181bool operator<( const Monomial & Mon1, const Monomial & Mon2 );
182
183}
184
185#endif /* COLORFULL_Monomial_h */
A class to contain the factor of form TR^a*Nc^b*CF^c*int_part*cnum_part, where the powers a,...
Definition: Monomial.h:23
void conjugate()
Take the complex conjugate.
Definition: Monomial.h:81
void write_out_Monomial(std::string filename) const
Function for writing out the Monomial to a file with name filename.
cnum cnum_part
Complex number multiplying the monomial.
Definition: Monomial.h:77
Monomial(double dnum)
Constructor using a double.
Definition: Monomial.h:35
Monomial(std::string str)
Constructor taking a string as argument.
void read_in_Monomial(std::string filename)
Function for reading in the Monomial from the file filename, uses Monomial_of_str.
void Monomial_of_str(std::string str)
Function for makinga a Monomial from a string.
int int_part
Integer multiplying the monomial, can be 0.
Definition: Monomial.h:74
Monomial(int num)
Constructor using an int.
Definition: Monomial.h:43
Monomial()
Default constructor sets int_part=cnum_part=1, and pow_Nc=pow_TR=pow_CF=0.
Definition: Monomial.h:27
int pow_CF
Power of CF=TR (Nc^2-1)/Nc.
Definition: Monomial.h:71
int pow_TR
Power of TR in Monomial.
Definition: Monomial.h:65
int pow_Nc
Power of the number of colors.
Definition: Monomial.h:68
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
string operator*(double, string)
ostream & operator<<(ostream &, const Collision &)