SAF
Loading...
Searching...
No Matches
saf_sh_internal.h
Go to the documentation of this file.
1/*
2 * Copyright 2016-2018 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
38#ifndef __SAF_SH_INTERNAL_H_INCLUDED__
39#define __SAF_SH_INTERNAL_H_INCLUDED__
40
41#include "saf_sh.h"
42#include "../saf_utilities/saf_utilities.h" /* for linear algebra speed-ups */
43#include "saf_externals.h"
44
45#ifdef __cplusplus
46extern "C" {
47#endif /* __cplusplus */
48
50typedef struct _sphPWD_data {
51 int order, nSH, nDirs;
52 float_complex* grid_svecs;
53 float_complex* A_Cx;
54 float* grid_dirs_xyz;
55 float* pSpec;
56 float* P_minus_peak;
57 float* P_tmp;
58 float* VM_mask;
59
61
63typedef struct _sphMUSIC_data {
64 int order, nSH, nDirs;
65 float_complex* grid_svecs;
66 float_complex* VnA;
67 float* grid_dirs_xyz;
68 float* abs_VnA;
69 float* pSpec;
70 float* pSpecInv;
71 float* P_minus_peak;
72 float* P_tmp;
73 float* VM_mask;
74
76
78typedef struct _sphESPRIT_data {
79 int N, NN, maxK;
80
81 /* matrices and indices to be pre-computed */
82 double* rWVnimu[6]; /* [6] x FLAT: N^2 x N^2 */
83 double_complex* WVnimu[6]; /* [6] x FLAT: N^2 x N^2 */
84 int* idx_from_Ynm2Ynimu[12]; /* [12] x nIdx[i] x 1 */
85 int nIdx[12]; /* number of indices in each "idx_from_Ynm2Ynimu" vector */
86
87 /* matrices for run-time */
88 void* hZpinv, *hZeigmp, *hZglslv;
89 double_complex* Us_1m1, *Us_m1m1, *Us_11, *Us_m11, *Us_m10, *Us_10, *Us_00;
90 double_complex* WVnimu0_Us1m1, *WVnimu1_Usm1m1, *WVnimu2_Us11;
91 double_complex* WVnimu3_Usm11, *WVnimu4_Usm10, *WVnimu5_Us10;
92 double_complex* LambdaXYp, *LambdaXYm, *LambdaZ;
93 double_complex* pinvUs, *PsiXYp, *PsiXYm, *PsiZ;
94 double_complex* tmp_KK, *V, *PhiXYp, *PhiXYm, *PhiZ;
95
97
98
99/* ========================================================================== */
100/* Misc. Internal Functions */
101/* ========================================================================== */
102
115float wigner_3j(/* Input arguments */
116 int j1,
117 int j2,
118 int j3,
119 int m1,
120 int m2,
121 int m3);
122
139void gaunt_mtx(/* Input arguments */
140 int N1,
141 int N2,
142 int N,
143 /* Output arguments */
144 float* A);
145
146
147/* ========================================================================== */
148/* Internal functions for spherical harmonic rotations */
149/* ========================================================================== */
150
152float getP(int M, int i, int l, int a, int b, float R_1[3][3], float* R_lm1);
153
155float getU(int M, int l, int m, int n, float R_1[3][3], float* R_lm1);
156
158float getV(int M, int l, int m, int n, float R_1[3][3], float* R_lm1);
159
161float getW(int M, int l, int m, int n, float R_1[3][3], float* R_lm1);
162
164float getW(int M, int l, int m, int n, float R_1[3][3], float* R_lm1);
165
166
167/* ========================================================================== */
168/* Internal functions for sphESPRIT */
169/* ========================================================================== */
170
172void getWnimu(int order, int mm, int ni, int mu, double* Wnimu);
173
175void getVnimu(int order, int ni, int mu, double* Vnimu);
176
178void muni2q(int order, int ni, int mu, int* idx_nimu, int* idx_nm);
179
180
181#ifdef __cplusplus
182} /* extern "C" */
183#endif /* __cplusplus */
184
185#endif /* __SAF_SH_INTERNAL_H_INCLUDED__ */
Include header for SAF externals.
Main header for the Spherical Harmonic Transform and Spherical Array Processing module (SAF_SH_MODULE...
void getVnimu(int order, int ni, int mu, double *Vnimu)
Helper function for sphESPRIT_create()
float getV(int M, int l, int m, int n, float R_1[3][3], float *R_lm1)
Helper function for getSHrotMtxReal()
void gaunt_mtx(int N1, int N2, int N, float *A)
Constructs a matrix of Guant coefficients.
float getU(int M, int l, int m, int n, float R_1[3][3], float *R_lm1)
Helper function for getSHrotMtxReal()
float getP(int M, int i, int l, int a, int b, float R_1[3][3], float *R_lm1)
Helper function for getSHrotMtxReal()
float getW(int M, int l, int m, int n, float R_1[3][3], float *R_lm1)
Helper function for getSHrotMtxReal()
void getWnimu(int order, int mm, int ni, int mu, double *Wnimu)
Helper function for sphESPRIT_create()
void muni2q(int order, int ni, int mu, int *idx_nimu, int *idx_nm)
Helper function for sphESPRIT_create()
float wigner_3j(int j1, int j2, int j3, int m1, int m2, int m3)
Computes the Wigner 3j symbol through the Racah formula found in http://mathworld....
Main header for the utilities module (SAF_UTILITIES_MODULE)
Internal data structure for sphESPRIT.
Internal data structure for sphMUSIC.
Internal data structure for sphPWD.