CLHEP  2.4.7.2
C++ Class Library for High Energy Physics
LegendreCoefficientSet.icc
Go to the documentation of this file.
1 #include <vector>
2 namespace Genfun {
3 
5 
6  public:
7 
8  std::vector<std::complex<double> > data;
9 
10  };
11 
12  inline
13  LegendreCoefficientSet::LegendreCoefficientSet(unsigned int LMAX):c(new Clockwork()){
14  for (unsigned int l=0;l<=LMAX;l++) {
15  c->data.push_back(0);
16  }
17  }
18 
19  inline
20  LegendreCoefficientSet::~LegendreCoefficientSet(){
21  delete c;
22  }
23 
24  inline
25  LegendreCoefficientSet::LegendreCoefficientSet(const LegendreCoefficientSet & right):
26  c(new Clockwork(*right.c))
27  {
28  }
29 
30  inline
31  unsigned int LegendreCoefficientSet::getLMax() const {
32  return c->data.size()-1;
33  }
34 
35  inline
36  const std::complex<double> &LegendreCoefficientSet:: operator () (unsigned int l) const {
37  return c->data[l];
38  }
39 
40  inline
41  std::complex<double> & LegendreCoefficientSet::operator () (unsigned int l) {
42  return c->data[l];
43  }
44 
45  inline
46  std::ostream & operator << ( std::ostream & o, const LegendreCoefficientSet & c)
47  {
48  for (unsigned int l=0;l<=c.getLMax();l++) {
49  o << l << " mag: " << c(l) << std::endl;
50  }
51  o << std::endl;
52  return o;
53  }
54 
55  inline
56  LegendreCoefficientSet & LegendreCoefficientSet::operator= (const LegendreCoefficientSet & source ){
57  if (this!=&source) {
58  delete c;
59  c = new Clockwork(*source.c);
60  }
61  return *this;
62  }
63 }
std::ostream & operator<<(std::ostream &o, const LegendreCoefficientSet &c)
Definition: Airy.icc:9
std::vector< std::complex< double > > data