50 static tsize
Num_Alms (
int l,
int m);
54 : lmax(lmax_), mmax(mmax_), tval(2*lmax+1) {}
57 void Set (
int lmax_,
int mmax_)
65 int Lmax()
const {
return lmax; }
67 int Mmax()
const {
return mmax; }
72 {
return ((m*(tval-m))>>1); }
81 {
return ((lmax==other.lmax) && (mmax==other.mmax)); }
95 Alm (
int lmax_=0,
int mmax_=0)
100 void Set (
int lmax_,
int mmax_)
108 void Set (arr<T> &data,
int lmax_,
int mmax_)
110 planck_assert (
Num_Alms(lmax_,mmax_)==data.size(),
"wrong array size");
120 template<
typename T2>
void Scale (
const T2 &factor)
121 {
for (tsize m=0; m<alm.size(); ++m) alm[m]*=factor; }
123 template<
typename T2>
void ScaleL (
const arr<T2> &factor)
125 planck_assert(factor.size()>tsize(lmax),
126 "alm.ScaleL: factor array too short");
127 for (
int m=0; m<=mmax; ++m)
128 for (
int l=m; l<=lmax; ++l)
129 operator()(l,m)*=factor[l];
132 template<
typename T2>
void ScaleL (
const std::vector<T2> &factor)
134 planck_assert(factor.size()>tsize(lmax),
135 "alm.ScaleL: factor array too short");
136 for (
int m=0; m<=mmax; ++m)
137 for (
int l=m; l<=lmax; ++l)
138 operator()(l,m)*=factor[l];
141 template<
typename T2>
void ScaleM (
const arr<T2> &factor)
143 planck_assert(factor.size()>tsize(mmax),
144 "alm.ScaleM: factor array too short");
145 for (
int m=0; m<=mmax; ++m)
146 for (
int l=m; l<=lmax; ++l)
147 operator()(l,m)*=factor[m];
150 template<
typename T2>
void Add (
const T2 &num)
155 {
return alm[
index(l,m)]; }
158 {
return alm[
index(l,m)]; }
170 const arr<T> &
Alms ()
const {
return alm; }
182 planck_assert (
conformable(other),
"A_lm are not conformable");
183 for (tsize m=0; m<alm.size(); ++m)
184 alm[m] += other.alm[m];
T & operator()(int l, int m)
void Set(arr< T > &data, int lmax_, int mmax_)
void ScaleL(const arr< T2 > &factor)
void Set(int lmax_, int mmax_)
void Set(int lmax_, int mmax_)
void Scale(const T2 &factor)
int index(int l, int m) const
void ScaleL(const std::vector< T2 > &factor)
static tsize Num_Alms(int l, int m)
void Add(const Alm &other)
const T * mstart(int m) const
int index_l0(int m) const
Alm(int lmax_=0, int mmax_=0)
bool conformable(const Alm_Base &other) const
const arr< T > & Alms() const
void swap(Alm_Base &other)
void ScaleM(const arr< T2 > &factor)
Alm_Base(int lmax_=0, int mmax_=0)