projects
/
my-code
/
api.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
finished 1d-dft
[my-code/api.git]
/
fourier
/
fourier.h
diff --git
a/fourier/fourier.h
b/fourier/fourier.h
index
5a8ddb3
..
39aee41
100644
(file)
--- a/
fourier/fourier.h
+++ b/
fourier/fourier.h
@@
-4,17
+4,17
@@
#define FOURIER_H
/* includes */
#define FOURIER_H
/* includes */
+#define _GNU_SOURCE
#include <stdio.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
/* defines */
#define F_SUCCESS 1
#define F_ERROR -1
/* 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 {
/* fourier specific variables */
typedef struct s_complex {
@@
-25,9
+25,22
@@
typedef struct s_complex {
typedef struct s_fourier {
int outfd;
unsigned char type;
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;
int dim;
+#define MAX_DIM 3
t_complex *data[MAX_DIM];
t_complex *data[MAX_DIM];
+ t_complex *ftdata[MAX_DIM];
int data_len[MAX_DIM];
} t_fourier;
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
#endif