#define FOURIER_H
/* includes */
+#define _GNU_SOURCE
#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
/* defines */
#define F_SUCCESS 1
#define F_ERROR -1
-#define F_DIM_ERROR -2
-#define F_DLEN_ERROR -3
-#define F_MALLOC_ERROR -4
-#define F_SET_DLEN_ERROR -5
-
-#define MAX_DIM 3
+#define F_NOT_SUPPORTED -2
+#define F_DIM_FAILURE -3
+#define F_ALLOC_FAIL -4
/* fourier specific variables */
typedef struct s_complex {
typedef struct s_fourier {
int outfd;
unsigned char type;
+#define DFT (1<<0)
+#define FFT (1<<1)
+#define FWD (1<<2)
+#define BWD (1<<3)
int dim;
+#define MAX_DIM 3
t_complex *data[MAX_DIM];
+ t_complex *ftdata[MAX_DIM];
int data_len[MAX_DIM];
} t_fourier;
+/* function prototypes */
+int fourier_init(t_fourier *fourier,int outfd);
+int fourier_dft_1d(t_fourier *fourier);
+int fourier_dft_2d(t_fourier *fourier);
+int fourier_dft_3d(t_fourier *fourier);
+int fourier_calc(t_fourier *fourier);
+
#endif