sharp_internal.h 2.43 KB
Newer Older
Martin Reinecke's avatar
Martin Reinecke committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 *  This file is part of libsharp2.
 *
 *  libsharp2 is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  libsharp2 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with libsharp2; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/* libsharp2 is being developed at the Max-Planck-Institut fuer Astrophysik */

/*! \file sharp_internal.h
 *  Internally used functionality for the spherical transform library.
 *
 *  Copyright (C) 2006-2019 Max-Planck-Society
 *  \author Martin Reinecke \author Dag Sverre Seljebotn
 */

#ifndef SHARP2_INTERNAL_H
#define SHARP2_INTERNAL_H

#include <complex>
#include "libsharp2/sharp.h"
Martin Reinecke's avatar
cleanup    
Martin Reinecke committed
33
#include "libsharp2/sharp_ylmgen.h"
Martin Reinecke's avatar
Martin Reinecke committed
34
35
36

using std::complex;

Martin Reinecke's avatar
Martin Reinecke committed
37
struct sharp_job
Martin Reinecke's avatar
Martin Reinecke committed
38
39
40
41
42
43
44
45
46
  {
  sharp_jobtype type;
  int spin;
  int nmaps, nalm;
  int flags;
  void **map;
  void **alm;
  int s_m, s_th; // strides in m and theta direction
  complex<double> *phase;
Martin Reinecke's avatar
Martin Reinecke committed
47
  vector<double> norm_l;
Martin Reinecke's avatar
Martin Reinecke committed
48
49
50
51
52
  complex<double> *almtmp;
  const sharp_geom_info *ginfo;
  const sharp_alm_info *ainfo;
  double time;
  unsigned long long opcnt;
Martin Reinecke's avatar
Martin Reinecke committed
53
54
55
56
57
58
59
60
  void build_common (sharp_jobtype type,
    int spin, void *alm, void *map, const sharp_geom_info &geom_info,
    const sharp_alm_info &alm_info, int flags);
  void alloc_phase (int nm, int ntheta, std::vector<complex<double>> &data);
  void alloc_almtmp (int lmax, std::vector<complex<double>> &data);
  void init_output();
  void alm2almtmp (int lmax, int mi);
  void almtmp2alm (int lmax, int mi);
61
  void ring2ringtmp (const sharp_geom_info::Tring &ri, std::vector<double> &ringtmp,
Martin Reinecke's avatar
Martin Reinecke committed
62
    int rstride);
63
  void ringtmp2ring (const sharp_geom_info::Tring &ri, const std::vector<double> &ringtmp, int rstride);
Martin Reinecke's avatar
Martin Reinecke committed
64
65
66
  void map2phase (int mmax, int llim, int ulim);
  void phase2map (int mmax, int llim, int ulim);
  void execute();
Martin Reinecke's avatar
Martin Reinecke committed
67
  };
Martin Reinecke's avatar
Martin Reinecke committed
68

Martin Reinecke's avatar
Martin Reinecke committed
69
void inner_loop (sharp_job &job, const int *ispair,const double *cth,
Martin Reinecke's avatar
Martin Reinecke committed
70
  const double *sth, int llim, int ulim, sharp_Ylmgen &gen, int mi,
Martin Reinecke's avatar
Martin Reinecke committed
71
72
73
74
75
  const int *mlim);

int sharp_max_nvec(int spin);

#endif