herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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 
17 namespace ColorFull {
18 
20 typedef std::vector< Polynomial> poly_vec;
21 
22 
25 class Poly_vec {
26 
27 
28 public:
29 
31  Poly_vec() {}
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 
64  void normal_order();
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 
84 std::ostream& operator<<( std::ostream& out, const poly_vec & poly_v );
85 
87 std::ostream& operator<<( std::ostream& out, const Poly_vec & Pv );
88 
91 bool operator==( const Poly_vec & Pv1, const Poly_vec & Pv2 );
92 
95 bool operator!=( const Poly_vec & Pv1, const Poly_vec & Pv2 );
96 
97 }
98 
99 
100 #endif /* COLORFULL_Poly_vec_h */
Polynomial & at(int i)
Returns the Polynomial at place i.
Definition: Poly_vec.h:43
void append(Polynomial Poly)
Appends a Polynomial to data member pv.
Definition: Poly_vec.h:53
poly_vec pv
To actually contain the polynomial information.
Definition: Poly_vec.h:37
Class for containing vector of Polynomials, and functions for Polynomial vectors. ...
Definition: Poly_vec.h:25
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
void simplify()
Simplifies all polynomials in the poly_vec member pv (uses the simplify member function in Polynomial...
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 clear()
Erases the information in vector.
Definition: Poly_vec.h:50
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 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()
Default constructor, leaves pv empty.
Definition: Poly_vec.h:31
const Monomial & at(int i) const
Returns Monomial at place i.
Definition: Polynomial.h:66
bool empty() const
Is the vector empty?
Definition: Poly_vec.h:56
vector< T > & operator<<(vector< T > &tv, const U &u)
Poly_vec(poly_vec poly_v)
Makes a Poly_vec of a poly_vec.
Definition: Poly_vec.h:34
void write_out_Poly_vec(std::string filename) const
Writes out the vector to the file filename.
void normal_order()
Normal order all Polynomials in the poly_vec member pv (uses the Polynomial.normal_order function...