|
My Project
|
#include <stdio.h>#include <stdlib.h>#include <complex.h>#include <time.h>#include <so3.h>Go to the source code of this file.
Macros | |
| #define | NREPEAT 10 |
| #define | MIN(a, b) ((a < b) ? (a) : (b)) |
| #define | MAX(a, b) ((a > b) ? (a) : (b)) |
Functions | |
| double | get_max_error (complex double *expected, complex double *actual, int n) |
| double | ran2_dp (int idum) |
| void | so3_test_gen_flmn_complex (complex double *flmn, const so3_parameters_t *parameters, int seed) |
| void | so3_test_gen_flmn_real (complex double *flmn, const so3_parameters_t *parameters, int seed) |
| int | main (int argc, char **argv) |
Applies SO3 algorithms to perform inverse and forward Wigner transforms (respectively) to check that the original signal is reconstructed exactly (to numerical precision). Test is performed on a random signal with harmonic coefficients uniformly sampled from (-1,1), once for a real and once for a complex signal. This test is run for multiple values of L and outputs the results in CSV format (to stdout). If no value for N is given in the arguments, each test will run with N = L, otherwise all tests will be run with the given N (and tests with L < N will be skipped). L will take all powers of 2 less or equal than the given Lmax. If L0 is given, all powers of 2 less than or equal to L0 will be skipped (and L0 will be used as the lower band-limit for all transforms).
Definition in file so3_test_csv.c.
| #define MAX | ( | a, | |
| b | |||
| ) | ((a > b) ? (a) : (b)) |
Definition at line 48 of file so3_test_csv.c.
| #define MIN | ( | a, | |
| b | |||
| ) | ((a < b) ? (a) : (b)) |
Definition at line 47 of file so3_test_csv.c.
| #define NREPEAT 10 |
Definition at line 46 of file so3_test_csv.c.
| double get_max_error | ( | complex double * | expected, |
| complex double * | actual, | ||
| int | n | ||
| ) |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 55 of file so3_test_csv.c.
References get_max_error(), NREPEAT, so3_core_forward_via_ssht(), so3_core_forward_via_ssht_real(), so3_core_inverse_via_ssht(), so3_core_inverse_via_ssht_real(), so3_sampling_flmn_size(), so3_test_gen_flmn_complex(), and so3_test_gen_flmn_real().
| double ran2_dp | ( | int | idum | ) |
Generate uniform deviate in range [0,1) given seed. (Using double precision.)
| [in] | idum | Seed. |
| ran_dp | Generated uniform deviate. |
Definition at line 426 of file so3_test_csv.c.
Referenced by so3_test_gen_flmn_complex(), and so3_test_gen_flmn_real().
| void so3_test_gen_flmn_complex | ( | complex double * | flmn, |
| const so3_parameters_t * | parameters, | ||
| int | seed | ||
| ) |
Generate random Wigner coefficients of a complex signal.
| [out] | flmn | Random spherical harmonic coefficients generated. Provide enough memory for fully padded storage, i.e. (2*N-1)*L*L elements. Unused trailing elements will be set to zero. |
| [in] | parameters | A parameters object with (at least) the following fields: L0, L, N, storage, n_mode The reality flag is ignored. Use so3_test_gen_flmn_real instead for real signals. |
| [in] | seed | Integer seed required for random number generator. |
| none |
Definition at line 253 of file so3_test_csv.c.
References MAX, ran2_dp(), and so3_sampling_elmn2ind().
Referenced by main().
| void so3_test_gen_flmn_real | ( | complex double * | flmn, |
| const so3_parameters_t * | parameters, | ||
| int | seed | ||
| ) |
Generate random Wigner coefficients of a real signal. We only generate coefficients for n >= 0, and for n = 0, we need flm0* = (-1)^(m)*fl-m0, so that fl00 has to be real.
| [out] | flmn | Random spherical harmonic coefficients generated. Provide enough memory for fully padded, complex (!) storage, i.e. (2*N-1)*L*L elements. Unused trailing elements will be set to zero. |
| [in] | parameters | A parameters object with (at least) the following fields: L0, L, N, storage, n_mode The reality flag is ignored. Use so3_test_gen_flmn_complex instead for complex signals. |
| [in] | seed | Integer seed required for random number generator. |
| none |
Definition at line 326 of file so3_test_csv.c.
References MAX, ran2_dp(), and so3_sampling_elmn2ind_real().
Referenced by main().