aboutsummaryrefslogtreecommitdiff
path: root/src/mtx_sh/sharmonics.h
blob: 78919f799fb58555ccc44937cd7a9bee4a51ca84 (plain)
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
33
34
35
36
37
38
39
40
41
42
43
/*
 * Recursive computation of (arbitrary degree) spherical harmonics, 
 * according to Gumerov and Duraiswami,
 * "The Fast Multipole Methods for the Helmholtz Equation in Three Dimensions",
 * Elsevier, 2005.
 *
 * Implementation by Franz Zotter, Institute of Electronic Music and Acoustics
 * (IEM), University of Music and Dramatic Arts (KUG), Graz, Austria
 * http://iem.at/Members/zotter, 2007.
 *
 * This code is published under the Gnu General Public License, see
 * "LICENSE.txt"
 */

#ifndef _sh_h__
#define _sh_h__

#include <stdlib.h>
#include "legendre_a.h"
#include "chebyshev12.h"
#include "sharmonics_normalization.h"

typedef struct _SHWorkSpace_
{
   size_t nmax;
   size_t l;
   
   double *y;

   SHNorml *wn;
   Cheby12WorkSpace *wc;
   LegendreWorkSpace *wl;

} SHWorkSpace;

SHWorkSpace *sharmonics_alloc(size_t nmax, size_t l);

void sharmonics_free(SHWorkSpace *sh);

void sharmonics(double *phi, double *theta, SHWorkSpace *ws);

#endif