NFFT  3.3.0
nfft3mp.h
1 /*
2  * Copyright (c) 2002, 2012 Jens Keiner, Stefan Kunis, Daniel Potts
3  *
4  * This program is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU General Public License as published by the Free Software
6  * Foundation; either version 2 of the License, or (at your option) any later
7  * version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc., 51
16  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 /* $Id$ */
20 
21 #ifndef __NFFT3MP_H__
22 #define __NFFT3MP_H__
23 
24 #include "nfft3.h"
25 
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif /* __cplusplus */
30 
31 #if defined(NFFT_PRECISION_SINGLE)
32 typedef float NFFT_R;
33 typedef float _Complex NFFT_C;
34 #define NFFT_K(x) ((NFFT_R) x)
35 #define NFFT_M(name) NFFT_CONCAT(name,f)
36 #define FFTW(name) NFFT_CONCAT(fftwf_,name)
37 #define NFFT(name) NFFT_CONCAT(nfftf_,name)
38 #define NFCT(name) NFFT_CONCAT(nfctf_,name)
39 #define NFST(name) NFFT_CONCAT(nfstf_,name)
40 #define NFSFT(name) NFFT_CONCAT(nfsftf_,name)
41 #define SOLVER(name) NFFT_CONCAT(solverf_,name)
42 #elif defined(NFFT_PRECISION_LONG_DOUBLE)
43 typedef long double NFFT_R;
44 typedef long double _Complex NFFT_C;
45 #define NFFT_K(x) ((NFFT_R) x##L)
46 #define NFFT_M(name) NFFT_CONCAT(name,l)
47 #define FFTW(name) NFFT_CONCAT(fftwl_,name)
48 #define NFFT(name) NFFT_CONCAT(nfftl_,name)
49 #define NFCT(name) NFFT_CONCAT(nfctl_,name)
50 #define NFST(name) NFFT_CONCAT(nfstl_,name)
51 #define NFSFT(name) NFFT_CONCAT(nfsftl_,name)
52 #define SOLVER(name) NFFT_CONCAT(solverl_,name)
53 #elif defined(NFFT_PRECISION_DOUBLE)
54 typedef double NFFT_R;
55 typedef double _Complex NFFT_C;
56 #define NFFT_K(x) ((NFFT_R) x)
57 #define NFFT_M(name) name
58 #define FFTW(name) NFFT_CONCAT(fftw_,name)
59 #define NFFT(name) NFFT_CONCAT(nfft_,name)
60 #define NFCT(name) NFFT_CONCAT(nfct_,name)
61 #define NFST(name) NFFT_CONCAT(nfst_,name)
62 #define NFSFT(name) NFFT_CONCAT(nfsft_,name)
63 #define SOLVER(name) NFFT_CONCAT(solver_,name)
64 #else
65 #error Either define macro NFFT_PRECISION_SINGLE, NFFT_PRECISION_DOUBLE or NFFT_PRECISION_LONG_DOUBLE for single, double or long double precision
66 #endif
67 
68 /* format strings */
69 #if defined(NFFT_PRECISION_LONG_DOUBLE)
70 # define NFFT__FGS__ "Lg"
71 # define NFFT__FES__ "LE"
72 # define NFFT__FE__ "% 36.32LE"
73 # define NFFT__FI__ "%Lf"
74 # define NFFT__FIS__ "Lf"
75 # define NFFT__FR__ "%La"
76 #elif defined(NFFT_PRECISION_SINGLE)
77 # define NFFT__FGS__ "g"
78 # define NFFT__FES__ "E"
79 # define NFFT__FE__ "% 12.8E"
80 # define NFFT__FI__ "%f"
81 # define NFFT__FIS__ "f"
82 # define NFFT__FR__ "%a"
83 #elif defined(NFFT_PRECISION_DOUBLE)
84 # define NFFT__FGS__ "lg"
85 # define NFFT__FES__ "lE"
86 # define NFFT__FE__ "% 20.16lE"
87 # define NFFT__FI__ "%lf"
88 # define NFFT__FIS__ "lf"
89 # define NFFT__FR__ "%la"
90 #else
91 #error Either define macro NFFT_PRECISION_SINGLE, NFFT_PRECISION_DOUBLE or NFFT_PRECISION_LONG_DOUBLE for single, double or long double precision
92 #endif
93 
94 #ifdef __cplusplus
95 } /* extern "C" */
96 #endif /* __cplusplus */
97 
99 #define NFFT_CSWAP(x,y) {NFFT_C* NFFT_SWAP_temp__; \
100  NFFT_SWAP_temp__=(x); (x)=(y); (y)=NFFT_SWAP_temp__;}
101 
102 #define NFFT_KPI NFFT_K(3.1415926535897932384626433832795028841971693993751)
103 
104 #endif /* defined(__NFFT3MP_H__) */