colorfull is hosted by Hepforge, IPPP Durham
ColorFull  1.1
/data/Documents/eclipse/workspace/ColorFull/Poly_matr.h
Go to the documentation of this file.
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 */
unsigned int uint
An unsigned int.
Definition: types.h:35
Poly_matr()
Default constructor, leaves pm empty.
Definition: Poly_matr.h:31
const Poly_vec & at(int i) const
Returns the Poly_vec at place i.
Definition: Poly_matr.h:37
void conjugate()
Conjugates the matrix.
Definition: Poly_vec.h:25
void write_out_Poly_matr(std::string filename) const
Writes out the matrix to the file filename.
bool operator==(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator == for two Col_amps.
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
std::vector< Poly_vec > poly_matr
To contain a matrix of Polynomials, a vector of Poly_vec.
Definition: Poly_matr.h:21
Poly_vec & at(int i)
Returns the Poly_vec at place i.
Definition: Poly_matr.h:40
const Polynomial & at(int i, int j) const
Returns the matrix element at i, j.
Definition: Poly_matr.h:46
void read_in_Poly_matr(std::string filename)
uint size() const
Definition: Poly_matr.h:53
bool empty() const
Is the matrix, stored in pm, empty?
Definition: Poly_matr.h:49
bool operator!=(const Col_amp &Ca1, const Col_amp &Ca2)
Define the operator != for two Col_amps.
Definition: Poly_matr.h:26
void clear()
Erases the matrix information.
Definition: Poly_matr.h:56
void append(Poly_vec Pv)
Appends a Poly_vec to data member pm.
Definition: Poly_matr.h:59
poly_matr pm
To actually contain the matrix of Polynomials.
Definition: Poly_matr.h:34
Polynomial & at(int i, int j)
Returns the matrix element at i, j.
Definition: Poly_matr.h:43
const Polynomial & at(int i) const
Returns the Polynomial at place i.
Definition: Poly_vec.h:40