herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
Poly_matr.h
1 // -*- C++ -*-
2 
3 /*
4  * Poly_matr.h
5  * Contains the declaration of the class Poly_matr and related types and operators.
6  * Created on: Aug 5, 2013
7  * Author: Malin Sjodahl
8  */
9 
10 #ifndef COLORFULL_Poly_matr_h
11 #define COLORFULL_Poly_matr_h
12 
13 
14 
15 #include "Poly_vec.h"
16 
17 
18 namespace ColorFull {
19 
21 typedef std::vector< Poly_vec > poly_matr;
22 
23 
26 class Poly_matr {
27 
28 public:
29 
31  Poly_matr() {}
32 
34  poly_matr pm;
35 
37  const Poly_vec& at( int i ) const {return pm.at(i);}
38 
40  Poly_vec& at( int i ) {return pm.at(i);}
41 
43  Polynomial& at( int i, int j ) { return pm.at(i).pv.at(j);}
44 
46  const Polynomial& at( int i, int j ) const { return pm.at(i).pv.at(j);}
47 
49  bool empty( ) const {return pm.empty();}
50 
53  uint size( ) const {return pm.size();}
54 
56  void clear() {pm.clear();}
57 
59  void append( Poly_vec Pv ) {pm.push_back( Pv );}
60 
63  void remove_CF();
64 
67  void normal_order();
68 
71  void simplify();
72 
74  void conjugate();
75 
82  void read_in_Poly_matr( std::string filename );
83 
85  void write_out_Poly_matr( std::string filename ) const;
86 
87 };
88 
90 std::ostream& operator<<( std::ostream& out, const poly_matr & pm );
91 
93 std::ostream& operator<<( std::ostream& out, const Poly_matr & Pm );
94 
97 bool operator==( const Poly_matr & Pm1, const Poly_matr & Pm2 );
98 
101 bool operator!=( const Poly_matr & Pm1, const Poly_matr & Pm2 );
102 
103 }
104 
105 
106 #endif /* COLORFULL_Poly_matr_h */
bool empty() const
Is the matrix, stored in pm, empty?
Definition: Poly_matr.h:49
void append(Poly_vec Pv)
Appends a Poly_vec to data member pm.
Definition: Poly_matr.h:59
uint size() const
Returns the size of the matrix, the number of Poly_vec&#39;s in the member pm.
Definition: Poly_matr.h:53
Class for containing vector of Polynomials, and functions for Polynomial vectors. ...
Definition: Poly_vec.h:25
void conjugate()
Conjugates the matrix.
void write_out_Poly_matr(std::string filename) const
Writes out the matrix to the file filename.
Poly_matr()
Default constructor, leaves pm empty.
Definition: Poly_matr.h:31
Class for containing a Polynomial matrix, and functions for Polynomial matrices.
Definition: Poly_matr.h:26
void clear()
Erases the matrix information.
Definition: Poly_matr.h:56
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition: Polynomial.h:30
const Polynomial & at(int i, int j) const
Returns the matrix element at i, j.
Definition: Poly_matr.h:46
poly_matr pm
To actually contain the matrix of Polynomials.
Definition: Poly_matr.h:34
void normal_order()
Normal orders all polynomials in the poly_matr member pm, (uses Polynomial.normal_order.)
const Polynomial & at(int i) const
Returns the Polynomial at place i.
Definition: Poly_vec.h:40
Poly_vec & at(int i)
Returns the Poly_vec at place i.
Definition: Poly_matr.h:40
const Monomial & at(int i) const
Returns Monomial at place i.
Definition: Polynomial.h:66
void remove_CF()
Remove CF in the poly_matr member pm, i.e., replace CF by TR (Nc^2-1)/Nc.
vector< T > & operator<<(vector< T > &tv, const U &u)
Polynomial & at(int i, int j)
Returns the matrix element at i, j.
Definition: Poly_matr.h:43
const Poly_vec & at(int i) const
Returns the Poly_vec at place i.
Definition: Poly_matr.h:37
void read_in_Poly_matr(std::string filename)
Reads in the matrix from the file filename.
void simplify()
Simplifies all polynomials in the poly_matr member pm, (uses Polynomial.simplify.) ...