herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
MatrixElement
Matchbox
ColorFull
Polynomial.h
1
// -*- C++ -*-
2
/*
3
* Polynomial.h
4
* Contains declaration of the class Polynomial and associated types and operators.
5
* Created on: Jul 7, 2010
6
* Author: Malin Sjodahl
7
*/
8
9
#ifndef COLORFULL_Polynomial_h
10
#define COLORFULL_Polynomial_h
11
12
#include "Monomial.h"
13
14
namespace
ColorFull {
15
22
typedef
std::vector < Monomial > polynomial;
23
24
30
class
Polynomial
{
31
public
:
32
34
Polynomial
(){};
35
40
Polynomial
(
const
std::string str );
41
45
Polynomial
(
double
dnum );
46
50
Polynomial
(
int
num );
51
55
polynomial
poly
;
56
59
void
read_in_Polynomial
( std::string filename );
60
63
void
write_out_Polynomial
( std::string filename )
const
;
64
66
const
Monomial
&
at
(
int
i )
const
{
return
poly
.at(i);}
67
69
Monomial
&
at
(
int
i ) {
return
poly
.at(i);}
70
72
int
size
()
const
{
return
poly
.size();}
73
75
void
append
(
const
Monomial
Mon ) {
poly
.push_back(Mon);}
76
78
void
erase
(
int
i ) {
poly
.erase(
poly
.begin() + i);}
79
81
bool
empty
()
const
{
return
poly
.empty();}
82
84
void
clear
() {
poly
.clear();}
85
88
void
conjugate
();
89
91
void
simplify
();
92
94
void
remove_CF
();
95
99
void
normal_order
();
100
101
private
:
103
int
factorial
(
int
i)
const
;
104
109
void
Polynomial_of_str
(
const
std::string str );
110
111
};
112
114
std::ostream&
operator<<
(std::ostream& out,
const
Polynomial
& Poly);
115
117
std::ostream&
operator<<
(std::ostream& out,
const
polynomial & poly);
118
122
bool
operator==
(
const
Polynomial
& Poly1,
const
Polynomial
& Poly2);
123
126
bool
operator!=(
const
Polynomial
& Poly1,
const
Polynomial
& Poly2 );
127
129
Polynomial
operator+
(
const
Polynomial
& Poly,
const
Monomial
& Mon );
130
133
Polynomial
operator+
(
const
Monomial
& Mon,
const
Polynomial
& Poly );
134
137
Polynomial
operator+=(
Polynomial
& Poly,
const
Monomial
& Mon );
138
141
Polynomial
operator+=(
Polynomial
& Poly1,
const
Polynomial
& Poly2 );
142
145
Polynomial
operator-(
const
Polynomial
& Poly,
const
Monomial
& Mon);
146
150
Polynomial
operator-(
const
Monomial
& Mon,
const
Polynomial
& Poly);
151
155
Polynomial
operator+
(
const
Polynomial
& Poly1,
const
Polynomial
& Poly2 );
156
159
Polynomial
operator-(
const
Polynomial
& Poly1,
const
Polynomial
& Poly2);
160
165
Polynomial
operator*
(
const
Polynomial
& Poly,
int
i );
166
169
Polynomial
operator*
(
int
i,
const
Polynomial
& Poly );
170
175
Polynomial
operator*
(
const
Polynomial
& Poly,
const
cnum c );
176
178
Polynomial
operator*
(
const
cnum c,
const
Polynomial
& Poly );
179
184
Polynomial
operator*
(
const
Polynomial
& Poly,
const
double
d );
185
187
Polynomial
operator*
(
const
double
d,
const
Polynomial
& Poly );
188
192
Polynomial
operator*
(
const
Polynomial
& Poly,
const
Monomial
& Mon );
193
196
Polynomial
operator*
(
const
Monomial
& Mon,
const
Polynomial
& Poly );
197
199
Polynomial
operator*
(
const
Polynomial
& Poly1,
const
Polynomial
& Poly2 );
200
203
Polynomial
operator*=(
Polynomial
& Poly,
const
int
i );
204
207
Polynomial
operator*=(
Polynomial
& Poly,
const
double
d );
208
211
Polynomial
operator*=(
Polynomial
& Poly,
const
cnum c );
212
215
Polynomial
operator*=(
Polynomial
& Poly,
const
Monomial
& Mon );
216
219
Polynomial
operator*=(
Polynomial
& Poly1,
const
Polynomial
& Poly2 );
220
221
}
222
223
224
#endif
/* COLORFULL_Polynomial_h */
ColorFull::Monomial
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
ColorFull::Polynomial
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition:
Polynomial.h:30
ColorFull::Polynomial::Polynomial
Polynomial(double dnum)
Constructor allowing setting the Polynomial using a double.
ColorFull::Polynomial::Polynomial_of_str
void Polynomial_of_str(const std::string str)
Function for setting the Polynomial using a string, used by string constructor.
ColorFull::Polynomial::clear
void clear()
Erases info in polynomial.
Definition:
Polynomial.h:84
ColorFull::Polynomial::poly
polynomial poly
Contains the polynomial, a sum of Monomials, as an std::vector of Monomials.
Definition:
Polynomial.h:55
ColorFull::Polynomial::append
void append(const Monomial Mon)
Adding a Monomial term.
Definition:
Polynomial.h:75
ColorFull::Polynomial::remove_CF
void remove_CF()
Replaces CF with TR*Nc-TR/Nc.
ColorFull::Polynomial::conjugate
void conjugate()
Take complex conjugate of the polynomial.
ColorFull::Polynomial::Polynomial
Polynomial(int num)
Constructor allowing setting the Polynomial using an int.
ColorFull::Polynomial::write_out_Polynomial
void write_out_Polynomial(std::string filename) const
Function for writing out the Polynomial to a file with name filename.
ColorFull::Polynomial::Polynomial
Polynomial(const std::string str)
Constructor allow setting the polynomial by using a string.
ColorFull::Polynomial::Polynomial
Polynomial()
Default constructor, leaves polynomial empty=1.
Definition:
Polynomial.h:34
ColorFull::Polynomial::read_in_Polynomial
void read_in_Polynomial(std::string filename)
Function for reading in the Polynomial from the file filename, uses Polynomial_of_str.
ColorFull::Polynomial::normal_order
void normal_order()
Orders terms in Polynomial in a unique form, first according to pow_Nc+pow_CF, then according to pow_...
ColorFull::Polynomial::empty
bool empty() const
Is the polynomial empty?
Definition:
Polynomial.h:81
ColorFull::Polynomial::at
const Monomial & at(int i) const
Returns Monomial at place i.
Definition:
Polynomial.h:66
ColorFull::Polynomial::simplify
void simplify()
Collects terms with same power of TR and Nc and Cf.
ColorFull::Polynomial::erase
void erase(int i)
Erases the Monomial at place i.
Definition:
Polynomial.h:78
ColorFull::Polynomial::factorial
int factorial(int i) const
The factorial of an int.
ColorFull::Polynomial::at
Monomial & at(int i)
Returns Monomial at place i.
Definition:
Polynomial.h:69
ColorFull::Polynomial::size
int size() const
Returns the number of terms in the Polynomial.
Definition:
Polynomial.h:72
ThePEG::operator==
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
ThePEG::operator+
XSecStat operator+(const XSecStat &x1, const XSecStat &x2)
ThePEG::operator*
string operator*(double, string)
ThePEG::operator<<
ostream & operator<<(ostream &, const Collision &)
Generated on Thu Jun 20 2024 17:50:52 for Herwig by
1.9.6