MINT2
Public Member Functions | List of all members
MultiQuarkContent Class Reference

#include <MultiQuarkContent.h>

Inheritance diagram for MultiQuarkContent:
MINT::PolymorphVector< QuarkContent >

Public Member Functions

 MultiQuarkContent ()
 
 MultiQuarkContent (const MultiQuarkContent &other)
 
void antiThis ()
 
bool initFromString (const std::string &str)
 
bool compatible (const MultiQuarkContent &other) const
 
void print (std::ostream &os=std::cout) const
 
MultiQuarkContentoperator+= (const MultiQuarkContent &rhs)
 
MultiQuarkContentoperator-= (const MultiQuarkContent &rhs)
 
MultiQuarkContent operator+ (const MultiQuarkContent &rhs) const
 
MultiQuarkContent operator- (const MultiQuarkContent &rhs) const
 
- Public Member Functions inherited from MINT::PolymorphVector< QuarkContent >
 PolymorphVector ()
 
 PolymorphVector (unsigned int N)
 
 PolymorphVector (unsigned int N, const QuarkContent &c)
 
 PolymorphVector (const PolymorphVector &other)
 
 PolymorphVector (const typename std::vector< QuarkContent > &other)
 
virtual ~PolymorphVector ()
 
std::vector< QuarkContent > & theVector ()
 
const std::vector< QuarkContent > & theVector () const
 
QuarkContentoperator[] (unsigned int i)
 
const QuarkContentoperator[] (unsigned int i) const
 
QuarkContentat (unsigned int i)
 
const QuarkContentat (unsigned int i) const
 
std::vector< QuarkContent >::iterator begin ()
 
std::vector< QuarkContent >::const_iterator begin () const
 
std::vector< QuarkContent >::iterator end ()
 
std::vector< QuarkContent >::const_iterator end () const
 
std::vector< QuarkContent >::iterator find (const QuarkContent &c)
 
std::vector< QuarkContent >::const_iterator find (const QuarkContent &c) const
 
QuarkContentfront ()
 
const QuarkContentfront () const
 
QuarkContentback ()
 
const QuarkContentback () const
 
unsigned int size () const
 
bool empty () const
 
void push_back (const QuarkContent &c)
 
void pop_back ()
 
void erase (typename std::vector< QuarkContent >::iterator pos)
 
void erase (typename std::vector< QuarkContent >::iterator first, typename std::vector< QuarkContent >::iterator last)
 
PolymorphVector< QuarkContent > & operator= (const PolymorphVector< QuarkContent > &other)
 
void clear ()
 
void resize (unsigned int N)
 
void resize (unsigned int N, const QuarkContent &c)
 
 operator const typename std::vector< QuarkContent > & () const
 
 operator typename std::vector< QuarkContent > & ()
 
bool operator== (const MINT::PolymorphVector< QuarkContent > &v2) const
 
bool operator!= (const MINT::PolymorphVector< QuarkContent > &v2) const
 
bool operator< (const MINT::PolymorphVector< QuarkContent > &v2) const
 
bool operator> (const MINT::PolymorphVector< QuarkContent > &v2) const
 

Additional Inherited Members

- Protected Attributes inherited from MINT::PolymorphVector< QuarkContent >
std::vector< QuarkContent_vec
 

Detailed Description

Definition at line 25 of file MultiQuarkContent.h.

Constructor & Destructor Documentation

◆ MultiQuarkContent() [1/2]

MultiQuarkContent::MultiQuarkContent ( )

◆ MultiQuarkContent() [2/2]

MultiQuarkContent::MultiQuarkContent ( const MultiQuarkContent other)

Member Function Documentation

◆ antiThis()

void MultiQuarkContent::antiThis ( )

Definition at line 14 of file MultiQuarkContent.cpp.

14  {
15  for(unsigned int i=0; i < this->size(); i++){
16  (*this)[i].antiThis();
17  }
18 }

◆ compatible()

bool MultiQuarkContent::compatible ( const MultiQuarkContent other) const

Definition at line 38 of file MultiQuarkContent.cpp.

38  {
39  for(unsigned int i=0; i < this->size(); i++){
40  for(unsigned int j=0; j < other.size(); j++){
41  if( (*this)[i] == other[j] ) return true;
42  }
43  }
44  return false;
45 
46 }

◆ initFromString()

bool MultiQuarkContent::initFromString ( const std::string &  str)

Definition at line 20 of file MultiQuarkContent.cpp.

20  {
21  unsigned int pos =str.find("non-qQ");
22  if(pos < str.size())return true;
23 
24  unsigned int posP = str.find("p(");
25  unsigned int posQ = str.find("q(");
26 
27  bool sc=true;
28  if(posP >= str.size() || posQ > str.size()){
29  sc &= (*this)[0].initFromString(str);
30  }else{
31  this->resize(2);
32  sc &= (*this)[0].initFromString(str.substr(posP, posQ));
33  sc &= (*this)[1].initFromString(str.substr(posQ, str.size()));
34  }
35  return sc;
36 }

◆ operator+()

MultiQuarkContent MultiQuarkContent::operator+ ( const MultiQuarkContent rhs) const

Definition at line 89 of file MultiQuarkContent.cpp.

89  {
90  MultiQuarkContent returnVal(*this);
91  returnVal += rhs;
92  return returnVal;
93 }

◆ operator+=()

MultiQuarkContent & MultiQuarkContent::operator+= ( const MultiQuarkContent rhs)

Definition at line 56 of file MultiQuarkContent.cpp.

56  {
57  if(this->size()*rhs.size() <= 1){
58  for(unsigned int i=0; i < this->size(); i++){
59  (*this)[i] += rhs[i];
60  }
61  }else{
62  MultiQuarkContent oldThis(*this);
63  this->clear();
64  for(unsigned int i=0; i < oldThis.size(); i++){
65  for(unsigned int j=0; j < rhs.size(); j++){
66  this->push_back(oldThis[i] + rhs[j]);
67  }
68  }
69  }
70  return *this;
71 }
void push_back(const QuarkContent &c)

◆ operator-()

MultiQuarkContent MultiQuarkContent::operator- ( const MultiQuarkContent rhs) const

Definition at line 94 of file MultiQuarkContent.cpp.

94  {
95  MultiQuarkContent returnVal(*this);
96  returnVal -= rhs;
97  return returnVal;
98 }

◆ operator-=()

MultiQuarkContent & MultiQuarkContent::operator-= ( const MultiQuarkContent rhs)

Definition at line 72 of file MultiQuarkContent.cpp.

72  {
73  if(this->size()*rhs.size() <= 1){
74  for(unsigned int i=0; i < this->size(); i++){
75  (*this)[i] -= rhs[i];
76  }
77  }else{
78  MultiQuarkContent oldThis(*this);
79  this->clear();
80  for(unsigned int i=0; i < oldThis.size(); i++){
81  for(unsigned int j=0; j < rhs.size(); j++){
82  this->push_back(oldThis[i] - rhs[j]);
83  }
84  }
85  }
86  return *this;
87 }
void push_back(const QuarkContent &c)

◆ print()

void MultiQuarkContent::print ( std::ostream &  os = std::cout) const

Definition at line 47 of file MultiQuarkContent.cpp.

47  {
48  os << "[";
49  for(unsigned int i=0; i < this->size(); i++){
50  if(i > 0 && i+1 < this->size()) os << ", ";
51  (*this)[i].print(os);
52  }
53  os << "]";
54 }

The documentation for this class was generated from the following files: