so3
1.3.0
Fast and exact Wigner transforms
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
#include "so3/so3_error.h"
#include "so3/so3_types.h"
Macros | |
#define | MAX(a, b) ((a > b) ? (a) : (b)) |
Functions | |
int | so3_sampling_nalpha (const so3_parameters_t *) |
int | so3_sampling_nbeta (const so3_parameters_t *) |
int | so3_sampling_ngamma (const so3_parameters_t *) |
complex double | so3_sampling_weight (const so3_parameters_t *parameters, int p) |
int | so3_sampling_f_size (const so3_parameters_t *parameters) |
int | so3_sampling_n (const so3_parameters_t *parameters) |
double | so3_sampling_a2alpha (int a, const so3_parameters_t *parameters) |
double | so3_sampling_b2beta (int b, const so3_parameters_t *parameters) |
double | so3_sampling_g2gamma (int g, const so3_parameters_t *parameters) |
int | so3_sampling_flmn_size (const so3_parameters_t *parameters) |
void | so3_sampling_elmn2ind (int *ind, int el, int m, int n, const so3_parameters_t *parameters) |
void | so3_sampling_ind2elmn (int *el, int *m, int *n, int ind, const so3_parameters_t *parameters) |
void | so3_sampling_elmn2ind_real (int *ind, int el, int m, int n, const so3_parameters_t *parameters) |
void | so3_sampling_ind2elmn_real (int *el, int *m, int *n, int ind, const so3_parameters_t *parameters) |
void | so3_sampling_n_loop_values (int *n_start, int *n_stop, int *n_inc, const so3_parameters_t *parameters) |
void | so3_sampling_el_loop_values (int *el_start, int *el_stop, int *el_inc, const int n, const so3_parameters_t *parameters) |
void | so3_sampling_m_loop_values (int *m_start, int *m_stop, int *m_inc, const int el) |
bool | so3_sampling_is_i_in_loop_range (const int i, const int i_start, const int i_stop, const int i_inc) |
bool | so3_sampling_is_elmn_non_zero (const int el, const int m, const int n, const so3_parameters_t *parameters) |
int | so3_sampling_is_elmn_non_zero_return_int (const int el, const int m, const int n, const so3_parameters_t *parameters) |
#define MAX | ( | a, | |
b | |||
) | ((a > b) ? (a) : (b)) |
double so3_sampling_a2alpha | ( | int | a, |
const so3_parameters_t * | parameters | ||
) |
Convert alpha index to angle for a given sampling scheme.
[in] | a | Alpha index. |
[in] | parameters | A parameters object with (at least) the following fields: L, sampling_scheme |
alpha | Alpha angle. |
double so3_sampling_b2beta | ( | int | b, |
const so3_parameters_t * | parameters | ||
) |
Convert beta index to angle for a given sampling scheme.
[in] | b | Beta index. |
[in] | parameters | A parameters object with (at least) the following fields: L, sampling_scheme |
beta | Beta angle. |
void so3_sampling_el_loop_values | ( | int * | el_start, |
int * | el_stop, | ||
int * | el_inc, | ||
const int | n, | ||
const so3_parameters_t * | parameters | ||
) |
Calculates the starting, stopping and increment of el that a applicable for a flmn. This is useful for looping over the whole array
[out] | el_start | starting el. |
[out] | el_stop | stopping el. |
[out] | el_inc | increment in el. |
[in] | n | The value of n the loop is being applied to. |
[in] | parameters | A parameters object with (at least) the following fields: L, N, storage The reality flag is ignored. Use so3_sampling_ind2elmn instead. |
none | example: so3_sampling_el_loop_values(&el_start, &el_stop, &el_inc, n, ¶meters); for (el = el_start; el <= el_stop; el +=el_inc){} |
void so3_sampling_elmn2ind | ( | int * | ind, |
int | el, | ||
int | m, | ||
int | n, | ||
const so3_parameters_t * | parameters | ||
) |
Convert (el,m,n) harmonic indices to 1D index used to access flmn array.
void so3_sampling_elmn2ind_real | ( | int * | ind, |
int | el, | ||
int | m, | ||
int | n, | ||
const so3_parameters_t * | parameters | ||
) |
Convert (el,m,n) harmonic indices to 1D index used to access flmn array for a real signal.
[out] | ind | 1D index to access flmn array. |
[in] | el | Harmonic index |
[in] | m | Azimuthal harmonic index. |
[in] | n | Orientational harmonic index. |
[in] | parameters | A parameters object with (at least) the following fields: L, N, storage The reality flag is ignored. Use so3_sampling_elmn2ind instead. |
none |
int so3_sampling_f_size | ( | const so3_parameters_t * | parameters | ) |
Compute size of the signal buffer f to be passed to the forward and returned from the inverse transform function for a given sampling scheme.
[in] | parameters | A parameters object with (at least) the following fields: L, N, sampling_scheme |
n | Number of samples stored in the signal buffers. |
int so3_sampling_flmn_size | ( | const so3_parameters_t * | parameters | ) |
double so3_sampling_g2gamma | ( | int | g, |
const so3_parameters_t * | parameters | ||
) |
Convert gamma index to angle for a given sampling scheme.
[in] | g | Gamma index. |
[in] | parameters | A parameters object with (at least) the following fields: N, sampling_scheme |
gamma | Gamma angle. |
void so3_sampling_ind2elmn | ( | int * | el, |
int * | m, | ||
int * | n, | ||
int | ind, | ||
const so3_parameters_t * | parameters | ||
) |
Convert 1D index used to access flmn array to (el,m,n) harmonic indices.
[out] | el | Harmonic index. |
[out] | m | Azimuthal harmonic index. |
[out] | n | Orientational harmonic index. |
[in] | ind | 1D index to access flm array. |
[in] | parameters | A parameters object with (at least) the following fields: L, N, storage The reality flag is ignored. Use so3_sampling_ind2elmn_real instead. |
none |
void so3_sampling_ind2elmn_real | ( | int * | el, |
int * | m, | ||
int * | n, | ||
int | ind, | ||
const so3_parameters_t * | parameters | ||
) |
Convert 1D index used to access flmn array to (el,m,n) harmonic indices for a real signal.
[out] | el | Harmonic index. |
[out] | m | Azimuthal harmonic index. |
[out] | n | Orientational harmonic index. |
[in] | ind | 1D index to access flm array. |
[in] | parameters | A parameters object with (at least) the following fields: L, N, storage The reality flag is ignored. Use so3_sampling_ind2elmn instead. |
none |
bool so3_sampling_is_elmn_non_zero | ( | const int | el, |
const int | m, | ||
const int | n, | ||
const so3_parameters_t * | parameters | ||
) |
Queries if (el,m,n) harmonic indices are non zero in this setting
[in] | el | Harmonic index. |
[in] | m | Azimuthal harmonic index. |
[in] | n | Orientational harmonic index. |
[in] | parameters | A parameters object with (at least) the following fields: L, N, storage, n_order, reality |
none |
int so3_sampling_is_elmn_non_zero_return_int | ( | const int | el, |
const int | m, | ||
const int | n, | ||
const so3_parameters_t * | parameters | ||
) |
bool so3_sampling_is_i_in_loop_range | ( | const int | i, |
const int | i_start, | ||
const int | i_stop, | ||
const int | i_inc | ||
) |
Queries if integer i would be covered in a loop for (i=i_start; i<=i_stop; i += i_inc)
[in] | i | integer to query |
[in] | i_start | starting point |
[in] | i_stop | stoping point |
[in] | i_inc | incrementing step |
none |
void so3_sampling_m_loop_values | ( | int * | m_start, |
int * | m_stop, | ||
int * | m_inc, | ||
const int | el | ||
) |
Calculates the starting, stopping and increment of m that a applicable for a flmn. This is useful for looping over the whole array
[out] | m_start | starting m. |
[out] | m_stop | stopping m. |
[out] | m_inc | increment in m. |
[in] | el | The value of el the loop is being applied to. |
none | example: so3_sampling_el_loop_values(&m_start, &m_stop, &m_inc, el); for (m = m_start; m <= m_stop; m +=m_inc){} |
int so3_sampling_n | ( | const so3_parameters_t * | parameters | ) |
Compute total number of samples for a given sampling scheme.
[in] | parameters | A parameters object with (at least) the following fields: L, N, sampling_scheme |
n | Number of samples. |
void so3_sampling_n_loop_values | ( | int * | n_start, |
int * | n_stop, | ||
int * | n_inc, | ||
const so3_parameters_t * | parameters | ||
) |
Calculates the starting, stopping and increment of n that a applicable for a flmn. This is useful for looping over the whole array
[out] | n_start | starting n. |
[out] | n_stop | stopping n. |
[out] | n_inc | increment in n. |
[in] | parameters | A parameters object with (at least) the following fields: L, N, storage The reality flag is ignored. Use so3_sampling_ind2elmn instead. example: so3_sampling_n_loop_values(&n_start, &n_stop, &n_inc, parameters); for (n = n_start; n <= n_stop; n += n_inc) {} |
none |
int so3_sampling_nalpha | ( | const so3_parameters_t * | parameters | ) |
Compute number of alpha samples for a given sampling scheme.
[in] | parameters | A parameters object with (at least) the following fields: L, sampling_scheme |
nalpha | Number of alpha samples. |
int so3_sampling_nbeta | ( | const so3_parameters_t * | parameters | ) |
Compute number of beta samples for a given sampling scheme.
[in] | parameters | A parameters object with (at least) the following fields: L, sampling_scheme |
nbeta | Number of beta samples. |
int so3_sampling_ngamma | ( | const so3_parameters_t * | parameters | ) |
Compute number of gamma samples for a given sampling scheme.
[in] | parameters | A parameters object with (at least) the following fields: B, sampling_scheme |
ngamma | Number of gamma samples. |
complex double so3_sampling_weight | ( | const so3_parameters_t * | parameters, |
int | p | ||
) |
Compute conjugate weights for toroidal extension.
[in] | parameters | A parameters object with (at least) sampling_scheme |
[in] | p | Integer index to compute weight for. |
Corresponding | conjugate weight. |