colorfull is hosted by Hepforge, IPPP Durham
ColorFull  1.1
/data/Documents/eclipse/workspace/ColorFull/Poly_vec.h
Go to the documentation of this file.
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 */
unsigned int uint
An unsigned int.
Definition: types.h:35
void read_in_Poly_vec(std::string filename)
poly_vec pv
To actually contain the polynomial information.
Definition: Poly_vec.h:37
void write_out_Poly_vec(std::string filename) const
Writes out the vector to the file filename.
std::vector< Polynomial > poly_vec
To contain a vector of Polynomials.
Definition: Poly_vec.h:20
Definition: Poly_vec.h:25
Polynomial & at(int i)
Returns the Polynomial at place i.
Definition: Poly_vec.h:43
bool empty() const
Is the vector empty?
Definition: Poly_vec.h:56
bool operator==(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator == for two Col_amps.
Poly_vec(poly_vec poly_v)
Makes a Poly_vec of a poly_vec.
Definition: Poly_vec.h:34
void conjugate()
Conjugates the Poly_vec.
Definition: Col_amp.h:15
Definition: Polynomial.h:30
std::ostream & operator<<(std::ostream &out, const col_amp &ca)
Define the operator << for col_amp.
const Monomial & at(int i) const
Returns Monomial at place i.
Definition: Polynomial.h:66
uint size() const
Definition: Poly_vec.h:47
void clear()
Erases the information in vector.
Definition: Poly_vec.h:50
Poly_vec()
Default constructor, leaves pv empty.
Definition: Poly_vec.h:31
bool operator!=(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator != for two Col_amps.
void append(Polynomial Poly)
Appends a Polynomial to data member pv.
Definition: Poly_vec.h:53
const Polynomial & at(int i) const
Returns the Polynomial at place i.
Definition: Poly_vec.h:40