herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Poly_vec.h
1// -*- C++ -*-
2
3/*
4 * Poly_vec.h
5 * Contains the declaration of the class Poly_vec related types and operators.
6 * Created on: Aug 5, 2013
7 * Author: Malin Sjodahl
8 */
9
10#ifndef COLORFULL_Poly_vec_h
11#define COLORFULL_Poly_vec_h
12
13
14#include "Polynomial.h"
15
16
17namespace ColorFull {
18
20typedef std::vector< Polynomial> poly_vec;
21
22
25class Poly_vec {
26
27
28public:
29
32
34 Poly_vec( poly_vec poly_v ){pv=poly_v;}
35
37 poly_vec pv;
38
40 const Polynomial& at( int i ) const { return pv.at(i); }
41
43 Polynomial& at( int i ) { return pv.at(i); }
44
47 uint size() const { return pv.size(); }
48
50 void clear() { pv.clear(); }
51
53 void append( Polynomial Poly ) { pv.push_back( Poly ); }
54
56 bool empty() const { return pv.empty(); }
57
60 void remove_CF();
61
65
68 void simplify();
69
71 void conjugate();
72
77 void read_in_Poly_vec( std::string filename );
78
80 void write_out_Poly_vec( std::string filename ) const;
81};
82
84std::ostream& operator<<( std::ostream& out, const poly_vec & poly_v );
85
87std::ostream& operator<<( std::ostream& out, const Poly_vec & Pv );
88
91bool operator==( const Poly_vec & Pv1, const Poly_vec & Pv2 );
92
95bool operator!=( const Poly_vec & Pv1, const Poly_vec & Pv2 );
96
97}
98
99
100#endif /* COLORFULL_Poly_vec_h */
Class for containing vector of Polynomials, and functions for Polynomial vectors.
Definition: Poly_vec.h:25
Poly_vec()
Default constructor, leaves pv empty.
Definition: Poly_vec.h:31
void read_in_Poly_vec(std::string filename)
Reads in a Polynomial vector of form {Poly1, Poly2,...} to the member pv from the file filename.
void conjugate()
Conjugates the Poly_vec.
uint size() const
Return the number of Polynomials in the vector, i.e., the size of the member pv.
Definition: Poly_vec.h:47
void remove_CF()
Remove CF in the poly_vec member pv, i.e., replace CF by TR*Nc -TR/Nc.
const Polynomial & at(int i) const
Returns the Polynomial at place i.
Definition: Poly_vec.h:40
Poly_vec(poly_vec poly_v)
Makes a Poly_vec of a poly_vec.
Definition: Poly_vec.h:34
void simplify()
Simplifies all polynomials in the poly_vec member pv (uses the simplify member function in Polynomial...
void write_out_Poly_vec(std::string filename) const
Writes out the vector to the file filename.
poly_vec pv
To actually contain the polynomial information.
Definition: Poly_vec.h:37
Polynomial & at(int i)
Returns the Polynomial at place i.
Definition: Poly_vec.h:43
void normal_order()
Normal order all Polynomials in the poly_vec member pv (uses the Polynomial.normal_order function....
void clear()
Erases the information in vector.
Definition: Poly_vec.h:50
bool empty() const
Is the vector empty?
Definition: Poly_vec.h:56
void append(Polynomial Poly)
Appends a Polynomial to data member pv.
Definition: Poly_vec.h:53
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 &)