herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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
18namespace ColorFull {
19
21typedef std::vector< Poly_vec > poly_matr;
22
23
26class Poly_matr {
27
28public:
29
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
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
90std::ostream& operator<<( std::ostream& out, const poly_matr & pm );
91
93std::ostream& operator<<( std::ostream& out, const Poly_matr & Pm );
94
97bool operator==( const Poly_matr & Pm1, const Poly_matr & Pm2 );
98
101bool operator!=( const Poly_matr & Pm1, const Poly_matr & Pm2 );
102
103}
104
105
106#endif /* COLORFULL_Poly_matr_h */
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
void read_in_Poly_matr(std::string filename)
Reads in the matrix from the file filename.
Poly_vec & at(int i)
Returns the Poly_vec at place i.
Definition: Poly_matr.h:40
const Poly_vec & at(int i) const
Returns the Poly_vec at place i.
Definition: Poly_matr.h:37
bool empty() const
Is the matrix, stored in pm, empty?
Definition: Poly_matr.h:49
poly_matr pm
To actually contain the matrix of Polynomials.
Definition: Poly_matr.h:34
uint size() const
Returns the size of the matrix, the number of Poly_vec's in the member pm.
Definition: Poly_matr.h:53
Polynomial & at(int i, int j)
Returns the matrix element at i, j.
Definition: Poly_matr.h:43
void append(Poly_vec Pv)
Appends a Poly_vec to data member pm.
Definition: Poly_matr.h:59
void remove_CF()
Remove CF in the poly_matr member pm, i.e., replace CF by TR (Nc^2-1)/Nc.
void normal_order()
Normal orders all polynomials in the poly_matr member pm, (uses Polynomial.normal_order....
const Polynomial & at(int i, int j) const
Returns the matrix element at i, j.
Definition: Poly_matr.h:46
void simplify()
Simplifies all polynomials in the poly_matr member pm, (uses Polynomial.simplify.)
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
void conjugate()
Conjugates the matrix.
Class for containing vector of Polynomials, and functions for Polynomial vectors.
Definition: Poly_vec.h:25
For containing a Polynomial (in Nc, CF and TR), as a sum of Monomials.
Definition: Polynomial.h:30
bool operator==(const LorentzVector< Value > &a, const LorentzVector< Value > &b)
ostream & operator<<(ostream &, const Collision &)