Herwig
7.2.1
|
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials. More...
#include <Polynomial.h>
Public Member Functions | |
Polynomial () | |
Default constructor, leaves polynomial empty=1. | |
Polynomial (const std::string str) | |
Constructor allow setting the polynomial by using a string. More... | |
Polynomial (double dnum) | |
Constructor allowing setting the Polynomial using a double. More... | |
Polynomial (int num) | |
Constructor allowing setting the Polynomial using an int. More... | |
void | read_in_Polynomial (std::string filename) |
Function for reading in the Polynomial from the file filename, uses Polynomial_of_str. More... | |
void | write_out_Polynomial (std::string filename) const |
Function for writing out the Polynomial to a file with name filename. More... | |
const Monomial & | at (int i) const |
Returns Monomial at place i. | |
Monomial & | at (int i) |
Returns Monomial at place i. | |
int | size () const |
Returns the number of terms in the Polynomial. | |
void | append (const Monomial Mon) |
Adding a Monomial term. | |
void | erase (int i) |
Erases the Monomial at place i. | |
bool | empty () const |
Is the polynomial empty? | |
void | clear () |
Erases info in polynomial. | |
void | conjugate () |
Take complex conjugate of the polynomial. More... | |
void | simplify () |
Collects terms with same power of TR and Nc and Cf. | |
void | remove_CF () |
Replaces CF with TR*Nc-TR/Nc. | |
void | normal_order () |
Orders terms in Polynomial in a unique form, first according to pow_Nc+pow_CF, then according to pow_Nc (for same pow_Nc+pow_CF) then according to int_part*num, then according to int_part, and finally according to pow_TR. More... | |
Public Attributes | |
polynomial | poly |
Contains the polynomial, a sum of Monomials, as an std::vector of Monomials. More... | |
Private Member Functions | |
int | factorial (int i) const |
The factorial of an int. | |
void | Polynomial_of_str (const std::string str) |
Function for setting the Polynomial using a string, used by string constructor. More... | |
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Note that a Monomial "is" TR^a*Nc^b*CF^c*int_part*cnum_part where int_part is an integer factor, cnum_part a complex numerical factor and a,b, and c integers (not necessarily positive). An empty Polynomial is defined as 1.
Definition at line 30 of file Polynomial.h.
ColorFull::Polynomial::Polynomial | ( | const std::string | str | ) |
Constructor allow setting the polynomial by using a string.
Should be used as for example "Polynomial Poly("(-20*TR^(5))/Nc + 28*Nc*TR^(5) - 10*Nc^3*TR^(5)")". The Momomials should be separated by + or -, see also the Monomial string constructor.
ColorFull::Polynomial::Polynomial | ( | double | dnum | ) |
Constructor allowing setting the Polynomial using a double.
The Polynomial gets one Monomial where the real part of cnum_part gets the value of dnum.
ColorFull::Polynomial::Polynomial | ( | int | num | ) |
Constructor allowing setting the Polynomial using an int.
The Polynomial gets one Monomial where int_part has the value num.
void ColorFull::Polynomial::conjugate | ( | ) |
Take complex conjugate of the polynomial.
Note that this changes the Polynomial itself.
Referenced by clear().
void ColorFull::Polynomial::normal_order | ( | ) |
Orders terms in Polynomial in a unique form, first according to pow_Nc+pow_CF, then according to pow_Nc (for same pow_Nc+pow_CF) then according to int_part*num, then according to int_part, and finally according to pow_TR.
Referenced by clear().
|
private |
Function for setting the Polynomial using a string, used by string constructor.
The Momomials should be separated by + or -, see also the Monomial string constructor.
Referenced by clear().
void ColorFull::Polynomial::read_in_Polynomial | ( | std::string | filename | ) |
Function for reading in the Polynomial from the file filename, uses Polynomial_of_str.
void ColorFull::Polynomial::write_out_Polynomial | ( | std::string | filename | ) | const |
Function for writing out the Polynomial to a file with name filename.
polynomial ColorFull::Polynomial::poly |
Contains the polynomial, a sum of Monomials, as an std::vector of Monomials.
An empty Polynomial is defined as 1, to get 0, multiply with 0.
Definition at line 55 of file Polynomial.h.
Referenced by clear().