#include <WeightContainer.h>
Public Types | |
typedef std::vector< double >::iterator | iterator |
iterator for the weight container | |
typedef std::vector< double >::const_iterator | const_iterator |
const iterator for the weight container | |
Public Member Functions | |
WeightContainer (unsigned int n=0, const double &value=0.) | |
default constructor | |
WeightContainer (const std::vector< double > &weights) | |
construct from a vector of weights | |
WeightContainer (const WeightContainer &in) | |
copy | |
virtual | ~WeightContainer () |
void | swap (WeightContainer &other) |
swap | |
WeightContainer & | operator= (const WeightContainer &) |
copy | |
WeightContainer & | operator= (const std::vector< double > &in) |
copy | |
void | print (std::ostream &ostr=std::cout) const |
print weights | |
int | size () const |
size of weight container | |
bool | empty () const |
return true if weight container is empty | |
void | push_back (const double &) |
push onto weight container | |
void | pop_back () |
pop from weight container | |
void | clear () |
clear the weight container | |
double & | operator[] (unsigned int n) |
access the weight container | |
const double & | operator[] (unsigned int n) const |
access the weight container | |
double & | front () |
returns the first element | |
const double & | front () const |
returns the first element | |
double & | back () |
returns the last element | |
const double & | back () const |
returns the last element | |
iterator | begin () |
begining of the weight container | |
iterator | end () |
end of the weight container | |
const_iterator | begin () const |
begining of the weight container | |
const_iterator | end () const |
end of the weight container | |
Private Attributes | |
std::vector< double > | m_weights |
Definition at line 24 of file WeightContainer.h.
typedef std::vector<double>::iterator HepMC::WeightContainer::iterator |
typedef std::vector<double>::const_iterator HepMC::WeightContainer::const_iterator |
HepMC::WeightContainer::WeightContainer | ( | unsigned int | n = 0 , |
|
const double & | value = 0. | |||
) | [inline] |
HepMC::WeightContainer::WeightContainer | ( | const std::vector< double > & | weights | ) | [inline] |
construct from a vector of weights
Definition at line 96 of file WeightContainer.h.
00097 : m_weights(wgts) 00098 {}
HepMC::WeightContainer::WeightContainer | ( | const WeightContainer & | in | ) | [inline] |
HepMC::WeightContainer::~WeightContainer | ( | ) | [inline, virtual] |
void HepMC::WeightContainer::swap | ( | WeightContainer & | other | ) | [inline] |
WeightContainer & HepMC::WeightContainer::operator= | ( | const WeightContainer & | ) | [inline] |
copy
best practices implementation
Definition at line 110 of file WeightContainer.h.
00110 { 00112 WeightContainer tmp( in ); 00113 swap( tmp ); 00114 return *this; 00115 }
WeightContainer & HepMC::WeightContainer::operator= | ( | const std::vector< double > & | in | ) | [inline] |
copy
best practices implementation
Definition at line 118 of file WeightContainer.h.
00118 { 00120 WeightContainer tmp( in ); 00121 swap( tmp ); 00122 return *this; 00123 }
void HepMC::WeightContainer::print | ( | std::ostream & | ostr = std::cout |
) | const [inline] |
print weights
Definition at line 125 of file WeightContainer.h.
00126 { 00127 for ( const_iterator w = begin(); w != end(); ++w ) 00128 { 00129 ostr << *w << " "; 00130 } 00131 ostr << std::endl; 00132 }
int HepMC::WeightContainer::size | ( | ) | const [inline] |
size of weight container
Definition at line 134 of file WeightContainer.h.
00134 { return m_weights.size(); }
bool HepMC::WeightContainer::empty | ( | ) | const [inline] |
return true if weight container is empty
Definition at line 136 of file WeightContainer.h.
00136 { return m_weights.empty(); }
void HepMC::WeightContainer::push_back | ( | const double & | ) | [inline] |
push onto weight container
Definition at line 138 of file WeightContainer.h.
00139 { m_weights.push_back(value); }
void HepMC::WeightContainer::pop_back | ( | ) | [inline] |
pop from weight container
Definition at line 141 of file WeightContainer.h.
00141 { m_weights.pop_back(); }
void HepMC::WeightContainer::clear | ( | ) | [inline] |
clear the weight container
Definition at line 143 of file WeightContainer.h.
00143 { m_weights.clear(); }
double & HepMC::WeightContainer::operator[] | ( | unsigned int | n | ) | [inline] |
const double & HepMC::WeightContainer::operator[] | ( | unsigned int | n | ) | const [inline] |
double & HepMC::WeightContainer::front | ( | ) | [inline] |
returns the first element
Definition at line 151 of file WeightContainer.h.
00151 { return m_weights.front(); }
const double & HepMC::WeightContainer::front | ( | ) | const [inline] |
returns the first element
Definition at line 153 of file WeightContainer.h.
00154 { return m_weights.front(); }
double & HepMC::WeightContainer::back | ( | ) | [inline] |
returns the last element
Definition at line 156 of file WeightContainer.h.
00156 { return m_weights.back(); }
const double & HepMC::WeightContainer::back | ( | ) | const [inline] |
returns the last element
Definition at line 158 of file WeightContainer.h.
00159 { return m_weights.back(); }
WeightContainer::iterator HepMC::WeightContainer::begin | ( | ) | [inline] |
begining of the weight container
Definition at line 161 of file WeightContainer.h.
00162 { return m_weights.begin(); }
WeightContainer::iterator HepMC::WeightContainer::end | ( | ) | [inline] |
end of the weight container
Definition at line 164 of file WeightContainer.h.
00165 { return m_weights.end(); }
WeightContainer::const_iterator HepMC::WeightContainer::begin | ( | ) | const [inline] |
begining of the weight container
Definition at line 167 of file WeightContainer.h.
00168 { return m_weights.begin(); }
WeightContainer::const_iterator HepMC::WeightContainer::end | ( | ) | const [inline] |
end of the weight container
Definition at line 170 of file WeightContainer.h.
00171 { return m_weights.end(); }
std::vector<double> HepMC::WeightContainer::m_weights [private] |
Definition at line 84 of file WeightContainer.h.