5#ifndef FASTTRANSFORMS_H
6#define FASTTRANSFORMS_H
11typedef double ft_complex[2];
15 #define FT_GET_THREAD_NUM() omp_get_thread_num()
16 #define FT_GET_NUM_THREADS() omp_get_num_threads()
17 #define FT_GET_MAX_THREADS() omp_get_max_threads()
18 #define FT_SET_NUM_THREADS(x) omp_set_num_threads(x)
20 #define FT_GET_THREAD_NUM() 0
21 #define FT_GET_NUM_THREADS() 1
22 #define FT_GET_MAX_THREADS() 1
23 #define FT_SET_NUM_THREADS(x)
26#define FT_CONCAT(prefix, name, suffix) prefix ## name ## suffix
28void ft_horner(
const int n,
const double * c,
const int incc,
const int m,
double * x,
double * f);
29void ft_hornerf(
const int n,
const float * c,
const int incc,
const int m,
float * x,
float * f);
31void ft_clenshaw(
const int n,
const double * c,
const int incc,
const int m,
double * x,
double * f);
32void ft_clenshawf(
const int n,
const float * c,
const int incc,
const int m,
float * x,
float * f);
34void ft_orthogonal_polynomial_clenshaw(
const int n,
const double * c,
const int incc,
const double * A,
const double * B,
const double * C,
const int m,
double * x,
double * phi0,
double * f);
35void ft_orthogonal_polynomial_clenshawf(
const int n,
const float * c,
const int incc,
const float * A,
const float * B,
const float * C,
const int m,
float * x,
float * phi0,
float * f);
37void ft_eigen_eval(
const int n,
const double * c,
const int incc,
const double * A,
const double * B,
const double * C,
const int m,
double * x,
const int sign,
double * f);
38void ft_eigen_evalf(
const int n,
const float * c,
const int incc,
const float * A,
const float * B,
const float * C,
const int m,
float * x,
const int sign,
float * f);
39void ft_eigen_evall(
const int n,
const long double * c,
const int incc,
const long double * A,
const long double * B,
const long double * C,
const int m,
long double * x,
const int sign,
long double * f);
40#if defined(FT_QUADMATH)
42 typedef __float128 quadruple;
43 void ft_eigen_evalq(
const int n,
const quadruple * c,
const int incc,
const quadruple * A,
const quadruple * B,
const quadruple * C,
const int m, quadruple * x,
const int sign, quadruple * f);
46#define FT_SN (1U << 0)
47#define FT_CN (1U << 1)
48#define FT_DN (1U << 2)
50#define FT_MODIFIED_NMAX (1U << 30)
89ft_tb_eigen_FMM *
ft_plan_jacobi_to_jacobi(
const int norm1,
const int norm2,
const int n,
const double alpha,
const double beta,
const double gamma,
const double delta);
154ft_btb_eigen_FMM * ft_plan_associated_jacobi_to_jacobi(
const int norm1,
const int norm2,
const int n,
const int c,
const double alpha,
const double beta,
const double gamma,
const double delta);
155ft_btb_eigen_FMM * ft_plan_associated_laguerre_to_laguerre(
const int norm1,
const int norm2,
const int n,
const int c,
const double alpha,
const double beta);
156ft_btb_eigen_FMM * ft_plan_associated_hermite_to_hermite(
const int norm1,
const int norm2,
const int n,
const int c);
165ft_modified_plan *
ft_plan_modified_jacobi_to_jacobi(
const int n,
const double alpha,
const double beta,
const int nu,
const double * u,
const int nv,
const double * v,
const int verbose);
190ft_tb_eigen_FMMf *
ft_plan_jacobi_to_jacobif(
const int norm1,
const int norm2,
const int n,
const float alpha,
const float beta,
const float gamma,
const float delta);
206ft_btb_eigen_FMMf * ft_plan_associated_jacobi_to_jacobif(
const int norm1,
const int norm2,
const int n,
const int c,
const float alpha,
const float beta,
const float gamma,
const float delta);
207ft_btb_eigen_FMMf * ft_plan_associated_laguerre_to_laguerref(
const int norm1,
const int norm2,
const int n,
const int c,
const float alpha,
const float beta);
208ft_btb_eigen_FMMf * ft_plan_associated_hermite_to_hermitef(
const int norm1,
const int norm2,
const int n,
const int c);
211ft_modified_planf *
ft_plan_modified_jacobi_to_jacobif(
const int n,
const float alpha,
const float beta,
const int nu,
const float * u,
const int nv,
const float * v,
const int verbose);
224ft_tb_eigen_FMMl *
ft_plan_jacobi_to_jacobil(
const int norm1,
const int norm2,
const int n,
const long double alpha,
const long double beta,
const long double gamma,
const long double delta);
228ft_tb_eigen_FMMl *
ft_plan_jacobi_to_ultrasphericall(
const int normjac,
const int normultra,
const int n,
const long double alpha,
const long double beta,
const long double lambda);
230ft_tb_eigen_FMMl *
ft_plan_ultraspherical_to_jacobil(
const int normultra,
const int normjac,
const int n,
const long double lambda,
const long double alpha,
const long double beta);
240ft_btb_eigen_FMMl * ft_plan_associated_jacobi_to_jacobil(
const int norm1,
const int norm2,
const int n,
const int c,
const long double alpha,
const long double beta,
const long double gamma,
const long double delta);
241ft_btb_eigen_FMMl * ft_plan_associated_laguerre_to_laguerrel(
const int norm1,
const int norm2,
const int n,
const int c,
const long double alpha,
const long double beta);
242ft_btb_eigen_FMMl * ft_plan_associated_hermite_to_hermitel(
const int norm1,
const int norm2,
const int n,
const int c);
245ft_modified_planl *
ft_plan_modified_jacobi_to_jacobil(
const int n,
const long double alpha,
const long double beta,
const int nu,
const long double * u,
const int nv,
const long double * v,
const int verbose);
259void ft_mpfr_destroy_plan(mpfr_t * A,
int n);
260void ft_mpfr_trmv(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t * x, mpfr_rnd_t rnd);
261void ft_mpfr_trsv(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t * x, mpfr_rnd_t rnd);
262void ft_mpfr_trmm(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t * B,
int LDB,
int N, mpfr_rnd_t rnd);
263void ft_mpfr_trsm(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t * B,
int LDB,
int N, mpfr_rnd_t rnd);
266void ft_mpfr_trmv_ptr(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t ** x, mpfr_rnd_t rnd);
267void ft_mpfr_trsv_ptr(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t ** x, mpfr_rnd_t rnd);
268void ft_mpfr_trmm_ptr(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t ** B,
int LDB,
int N, mpfr_rnd_t rnd);
269void ft_mpfr_trsm_ptr(
char TRANS,
int n, mpfr_t * A,
int LDA, mpfr_t ** B,
int LDB,
int N, mpfr_rnd_t rnd);
278mpfr_t *
ft_mpfr_plan_jacobi_to_jacobi(
const int norm1,
const int norm2,
const int n, mpfr_srcptr alpha, mpfr_srcptr beta, mpfr_srcptr gamma, mpfr_srcptr delta, mpfr_prec_t prec, mpfr_rnd_t rnd);
310ft_rotation_plan * ft_plan_rottriangle(
const int n,
const double alpha,
const double beta,
const double gamma);
317ft_rotation_plan * ft_plan_rotdisk(
const int n,
const double alpha,
const double beta);
318ft_rotation_plan * ft_plan_rotannulus(
const int n,
const double alpha,
const double beta,
const double gamma,
const double rho);
332void ft_kernel_tet_hi2lo(
const ft_rotation_plan * RP,
const int L,
const int m,
double * A);
333void ft_kernel_tet_lo2hi(
const ft_rotation_plan * RP,
const int L,
const int m,
double * A);
349void ft_execute_sph_hi2lo(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
350void ft_execute_sph_lo2hi(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
352void ft_execute_sphv_hi2lo(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
353void ft_execute_sphv_lo2hi(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
355void ft_execute_tri_hi2lo(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
356void ft_execute_tri_lo2hi(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
358void ft_execute_disk_hi2lo(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
359void ft_execute_disk_lo2hi(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
361void ft_execute_rectdisk_hi2lo(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
362void ft_execute_rectdisk_lo2hi(
const ft_rotation_plan * RP,
double * A,
double * B,
const int M);
367void ft_execute_spinsph_hi2lo(
const ft_spin_rotation_plan * SRP, ft_complex * A, ft_complex * B,
const int M);
368void ft_execute_spinsph_lo2hi(
const ft_spin_rotation_plan * SRP, ft_complex * A, ft_complex * B,
const int M);
373 ft_modified_plan ** MP;
398void ft_execute_sphv2fourier(
const char TRANS,
const ft_harmonic_plan * P,
double * A,
const int N,
const int M);
399void ft_execute_fourier2sphv(
const char TRANS,
const ft_harmonic_plan * P,
double * A,
const int N,
const int M);
464int ft_fftw_init_threads(
void);
465void ft_fftw_plan_with_nthreads(
const int n);
468 fftw_plan plantheta1;
469 fftw_plan plantheta2;
470 fftw_plan plantheta3;
471 fftw_plan plantheta4;
479ft_sphere_fftw_plan * ft_plan_sph_with_kind(
const int N,
const int M,
const fftw_r2r_kind kind[3][1],
const unsigned flags);
484ft_sphere_fftw_plan * ft_plan_sphv_synthesis(
const int N,
const int M,
const unsigned flags);
485ft_sphere_fftw_plan * ft_plan_sphv_analysis(
const int N,
const int M,
const unsigned flags);
492void ft_execute_sphv_synthesis(
const char TRANS,
const ft_sphere_fftw_plan * P,
double * X,
const int N,
const int M);
493void ft_execute_sphv_analysis(
const char TRANS,
const ft_sphere_fftw_plan * P,
double * X,
const int N,
const int M);
502ft_triangle_fftw_plan * ft_plan_tri_with_kind(
const int N,
const int M,
const fftw_r2r_kind kind0,
const fftw_r2r_kind kind1,
const unsigned flags);
519ft_tetrahedron_fftw_plan * ft_plan_tet_with_kind(
const int N,
const int L,
const int M,
const fftw_r2r_kind kind0,
const fftw_r2r_kind kind1,
const fftw_r2r_kind kind2,
const unsigned flags);
523void ft_execute_tet_synthesis(
const char TRANS,
const ft_tetrahedron_fftw_plan * P,
double * X,
const int N,
const int L,
const int M);
524void ft_execute_tet_analysis(
const char TRANS,
const ft_tetrahedron_fftw_plan * P,
double * X,
const int N,
const int L,
const int M);
538ft_disk_fftw_plan * ft_plan_disk_with_kind(
const int N,
const int M,
const fftw_r2r_kind kind[3][1],
const unsigned flags);
562ft_annulus_fftw_plan * ft_plan_annulus_with_kind(
const int N,
const int M,
const double rho,
const fftw_r2r_kind kind[3][1],
const unsigned flags);
582ft_rectdisk_fftw_plan * ft_plan_rectdisk_with_kind(
const int N,
const int M,
const fftw_r2r_kind kind[3][1],
const unsigned flags);
594 fftw_plan plantheta1;
595 fftw_plan plantheta2;
596 fftw_plan plantheta3;
597 fftw_plan plantheta4;
608ft_spinsphere_fftw_plan * ft_plan_spinsph_with_kind(
const int N,
const int M,
const int S,
const fftw_r2r_kind kind[2][1],
const int sign,
const unsigned flags);
621 ft_triangular_banded ** T;
629void ft_execute_sph_gradient(
ft_gradient_plan * P,
double * U,
double * Ut,
double * Up,
const int N,
const int M);
630void ft_execute_sph_curl(
ft_gradient_plan * P,
double * U,
double * Ut,
double * Up,
const int N,
const int M);
633 ft_triangular_banded ** T;
643void ft_execute_sph_helmholtzhodge(
ft_helmholtzhodge_plan * P,
double * U1,
double * U2,
double * V1,
double * V2,
const int N,
const int M);
691void ft_execute_sph_polar_rotation(
double * A,
const int N,
const int M,
double s,
double c);
693void ft_execute_sph_polar_reflection(
double * A,
const int N,
const int M);
696 ft_symmetric_tridiagonal_symmetric_eigen * F11;
697 ft_symmetric_tridiagonal_symmetric_eigen * F21;
698 ft_symmetric_tridiagonal_symmetric_eigen * F12;
699 ft_symmetric_tridiagonal_symmetric_eigen * F22;
716void ft_execute_sph_yz_axis_exchange(
ft_sph_isometry_plan * J,
double * A,
const int N,
const int M);
720void ft_execute_sph_rotation(
ft_sph_isometry_plan * J,
const double alpha,
const double beta,
const double gamma,
double * A,
const int N,
const int M);
Every orthogonal matrix can be decomposed as a product of Euler angles and, if necessary,...
Definition fasttransforms.h:672
Definition fasttransforms.h:549
Definition fasttransforms.h:526
Definition fasttransforms.h:619
Data structure to store ft_rotation_plans, arrays to represent 1D orthogonal polynomial transforms an...
Definition fasttransforms.h:371
Definition fasttransforms.h:632
Definition fasttransforms.h:253
Definition fasttransforms.h:695
Definition fasttransforms.h:573
A static struct to store a reflection about the plane in .
Definition fasttransforms.h:681
Definition fasttransforms.h:703
Definition fasttransforms.h:467
Data structure to store a ft_spin_rotation_plan, and various arrays to represent 1D orthogonal polyno...
Definition fasttransforms.h:442
Definition fasttransforms.h:593
Definition fasttransforms.h:513
Definition fasttransforms.h:495