sharp_map_size and sharp_alm_count functions
This commit is contained in:
parent
c50c0fe27a
commit
cf7de6ba70
2 changed files with 33 additions and 0 deletions
|
@ -169,6 +169,19 @@ ptrdiff_t sharp_alm_index (const sharp_alm_info *self, int l, int mi)
|
|||
return self->mvstart[mi]+self->stride*l;
|
||||
}
|
||||
|
||||
ptrdiff_t sharp_alm_count(const sharp_alm_info *self)
|
||||
{
|
||||
ptrdiff_t result=0;
|
||||
for (int im=0; im!=self->nm; ++im)
|
||||
{
|
||||
int m=self->mval[im];
|
||||
ptrdiff_t x=(self->lmax + 1 - m);
|
||||
if ((m!=0)&&((self->flags&SHARP_PACKED)!=0)) result+=2*x;
|
||||
else result+=x;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void sharp_destroy_alm_info (sharp_alm_info *info)
|
||||
{
|
||||
DEALLOC (info->mval);
|
||||
|
@ -226,6 +239,17 @@ void sharp_make_geom_info (int nrings, const int *nph, const ptrdiff_t *ofs,
|
|||
qsort(info->pair,info->npairs,sizeof(sharp_ringpair),ringpair_compare);
|
||||
}
|
||||
|
||||
ptrdiff_t sharp_map_size(const sharp_geom_info *info)
|
||||
{
|
||||
ptrdiff_t result = 0;
|
||||
for (int m=0; m<info->npairs; ++m)
|
||||
{
|
||||
result+=info->pair[m].r1.nph;
|
||||
result+=(info->pair[m].r2.nph>=0) ? (info->pair[m].r2.nph) : 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void sharp_destroy_geom_info (sharp_geom_info *geom_info)
|
||||
{
|
||||
DEALLOC (geom_info->pair);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue