poulpy/poulpy-backend/src/cpu_spqlios/spqlios-arithmetic/spqlios/reim4/reim4_fftvec_public.h
poulpy-backend/src/cpu_spqlios/spqlios-arithmetic/spqlios/reim4/reim4_fftvec_public.hRaw
1#ifndef SPQLIOS_REIM4_FFTVEC_PUBLIC_H
2#define SPQLIOS_REIM4_FFTVEC_PUBLIC_H
3
4#include "../commons.h"
5
6typedef struct reim4_addmul_precomp REIM4_FFTVEC_ADDMUL_PRECOMP;
7typedef struct reim4_mul_precomp REIM4_FFTVEC_MUL_PRECOMP;
8typedef struct reim4_from_cplx_precomp REIM4_FROM_CPLX_PRECOMP;
9typedef struct reim4_to_cplx_precomp REIM4_TO_CPLX_PRECOMP;
10
11EXPORT REIM4_FFTVEC_MUL_PRECOMP* new_reim4_fftvec_mul_precomp(uint32_t m);
12EXPORT void reim4_fftvec_mul(const REIM4_FFTVEC_MUL_PRECOMP* tables, double* r, const double* a, const double* b);
13#define delete_reim4_fftvec_mul_precomp free
14
15EXPORT REIM4_FFTVEC_ADDMUL_PRECOMP* new_reim4_fftvec_addmul_precomp(uint32_t nn);
16EXPORT void reim4_fftvec_addmul(const REIM4_FFTVEC_ADDMUL_PRECOMP* tables, double* r, const double* a, const double* b);
17#define delete_reim4_fftvec_addmul_precomp free
18
19/**
20 * @brief prepares a conversion from the cplx fftvec layout to the reim4 layout.
21 * @param m complex dimension m from C[X] mod X^m-i.
22 */
23EXPORT REIM4_FROM_CPLX_PRECOMP* new_reim4_from_cplx_precomp(uint32_t m);
24EXPORT void reim4_from_cplx(const REIM4_FROM_CPLX_PRECOMP* tables, double* r, const void* a);
25#define delete_reim4_from_cplx_precomp free
26
27/**
28 * @brief prepares a conversion from the reim4 fftvec layout to the cplx layout
29 * @param m the complex dimension m from C[X] mod X^m-i.
30 */
31EXPORT REIM4_TO_CPLX_PRECOMP* new_reim4_to_cplx_precomp(uint32_t m);
32EXPORT void reim4_to_cplx(const REIM4_TO_CPLX_PRECOMP* tables, void* r, const double* a);
33#define delete_reim4_to_cplx_precomp free
34
35/**
36 * @brief Simpler API for the fftvec multiplication function.
37 * For each dimension, the precomputed tables for this dimension are generated automatically the first time.
38 * It is advised to do one dry-run call per desired dimension before using in a multithread environment */
39EXPORT void reim4_fftvec_mul_simple(uint32_t m, double* r, const double* a, const double* b);
40
41/**
42 * @brief Simpler API for the fftvec addmul function.
43 * For each dimension, the precomputed tables for this dimension are generated automatically the first time.
44 * It is advised to do one dry-run call per desired dimension before using in a multithread environment */
45EXPORT void reim4_fftvec_addmul_simple(uint32_t m, double* r, const double* a, const double* b);
46
47/**
48 * @brief Simpler API for cplx conversion.
49 * For each dimension, the precomputed tables for this dimension are generated automatically the first time.
50 * It is advised to do one dry-run call per desired dimension before using in a multithread environment */
51EXPORT void reim4_from_cplx_simple(uint32_t m, double* r, const void* a);
52
53/**
54 * @brief Simpler API for to cplx conversion.
55 * For each dimension, the precomputed tables for this dimension are generated automatically the first time.
56 * It is advised to do one dry-run call per desired dimension before using in a multithread environment */
57EXPORT void reim4_to_cplx_simple(uint32_t m, void* r, const double* a);
58
59#endif // SPQLIOS_REIM4_FFTVEC_PUBLIC_H