summaryrefslogtreecommitdiff
path: root/types.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-30 11:23:38 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-30 11:23:38 -0300
commit947daeb85321ed804bc3142623844b2617cb1b3e (patch)
tree5e91dfa3bf674210854d9402714f2ae1b909f3c9 /types.hpp
parentd422676a24bc3967ab3f319d60f7798081dab4e5 (diff)
downloadcode-947daeb85321ed804bc3142623844b2617cb1b3e.tar.gz
code-947daeb85321ed804bc3142623844b2617cb1b3e.tar.bz2
code-947daeb85321ed804bc3142623844b2617cb1b3e.zip
Support long double in the integrator
Diffstat (limited to 'types.hpp')
-rw-r--r--types.hpp39
1 files changed, 38 insertions, 1 deletions
diff --git a/types.hpp b/types.hpp
index 05eceb4..71556fd 100644
--- a/types.hpp
+++ b/types.hpp
@@ -1,6 +1,43 @@
#pragma once
#include <complex>
+#include <fftw3.h>
+
+using namespace std::complex_literals;
+
+#ifndef QUAD_PRECISION
+
+#define FFTW_PLAN fftw_plan
+#define FFTW_ALLOC_COMPLEX fftw_alloc_complex
+#define FFTW_IMPORT_WISDOM fftw_import_wisdom_from_filename
+#define FFTW_EXPORT_WISDOM fftw_export_wisdom_to_filename
+#define FFTW_PLAN_DFT_1D fftw_plan_dft_1d
+#define FFTW_DESTROY_PLAN fftw_destroy_plan
+#define FFTW_FREE fftw_free
+#define FFTW_CLEANUP fftw_cleanup
+#define FFTW_EXECUTE fftw_execute
+#define FFTW_COMPLEX fftw_complex
using Real = double;
+
+#define II 1i
+
+#else
+
+#define FFTW_PLAN fftwl_plan
+#define FFTW_ALLOC_COMPLEX fftwl_alloc_complex
+#define FFTW_IMPORT_WISDOM fftwl_import_wisdom_from_filename
+#define FFTW_EXPORT_WISDOM fftwl_export_wisdom_to_filename
+#define FFTW_PLAN_DFT_1D fftwl_plan_dft_1d
+#define FFTW_DESTROY_PLAN fftwl_destroy_plan
+#define FFTW_FREE fftwl_free
+#define FFTW_CLEANUP fftwl_cleanup
+#define FFTW_EXECUTE fftwl_execute
+#define FFTW_COMPLEX fftwl_complex
+
+using Real = long double;
+
+#define II 1il
+
+#endif
+
using Complex = std::complex<Real>;
-using namespace std::complex_literals;