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_)
120 template<
typename T2>
void Scale (
const T2 &factor)
121 {
for (
tsize m=0; m<alm.
size(); ++m) alm[m]*=factor; }
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)
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];
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)]; }
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)
void transfer(arrT &other)
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
#define planck_assert(testval, msg)
void swap(Alm_Base &other)
void ScaleM(const arr< T2 > &factor)
Alm_Base(int lmax_=0, int mmax_=0)