Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[ff23f8]: src / ltfat.h Maximize Restore History

Download this file

ltfat.h    171 lines (121 with data), 3.7 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#ifndef LTFAT_H
#define LTFAT_H 1
#include <complex.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <math.h>
#include "fftw3.h"
#include "cblas.h"
#ifndef PI
#define PI 3.1415926535897932384626433832795
#endif
// SAFE SIGNED AND UNSIGNED INTEGERS
typedef size_t ltSize;
typedef size_t ltIndex;
typedef ptrdiff_t ltInt;
#define LTFAT_MAKENAME(name,type,comp) name ## _ ## comp ## type
#define LTFAT_NAME_DOUBLE(name) LTFAT_MAKENAME(name,d,)
#define LTFAT_NAME_SINGLE(name) LTFAT_MAKENAME(name,s,)
#define LTFAT_NAME_COMPLEXDOUBLE(name) LTFAT_MAKENAME(name,d,c)
#define LTFAT_NAME_COMPLEXSINGLE(name) LTFAT_MAKENAME(name,s,c)
/* BEGIN_C_DECLS */
#ifdef __cplusplus
extern "C"
{
#endif
/* Handle Windows DLL files, not used */
/* defined by Makefile when compiling LTFAT */
#if defined(DLL_EXPORT_SYMBOLS) && (defined(_WIN32) || defined(__WIN32__))
# define LTFAT_EXTERN extern __declspec(dllexport)
#else
# define LTFAT_EXTERN
#endif
/* -------- Define the single precision routines ----- */
#ifndef LTFAT_DOUBLE
#ifndef LTFAT_SINGLE
# define LTFAT_SINGLE_WASNOTDEFINED
# define LTFAT_SINGLE
#endif
# include "ltfat_types.h"
# include "ltfat_typecomplexindependent.h"
# define LTFAT_COMPLEXTYPE
# include "ltfat_types.h"
# include "ltfat_typecomplexindependent.h"
# undef LTFAT_COMPLEXTYPE
# include "ltfat_types.h"
# include "ltfat_typeindependent.h"
# ifdef LTFAT_SINGLE_WASNOTDEFINED
# undef LTFAT_SINGLE
# undef LTFAT_SINGLE_WASNOTDEFINED
# endif
#endif
/* -------- Define the double precision routines ----- */
#ifndef LTFAT_SINGLE
#ifndef LTFAT_DOUBLE
# define LTFAT_DOUBLE_WASNOTDEFINED
# define LTFAT_DOUBLE
#endif
#include "ltfat_types.h"
#include "ltfat_typecomplexindependent.h"
#define LTFAT_COMPLEXTYPE
#include "ltfat_types.h"
#include "ltfat_typecomplexindependent.h"
#undef LTFAT_COMPLEXTYPE
#include "ltfat_types.h"
#include "ltfat_typeindependent.h"
# ifdef LTFAT_DOUBLE_WASNOTDEFINED
# undef LTFAT_DOUBLE
# undef LTFAT_DOUBLE_WASNOTDEFINED
# endif
#endif
#undef LTFAT_COMPLEX
#undef LTFAT_REAL
#undef LTFAT_TYPE
#undef LTFAT_NAME
#undef LTFAT_NAME_REAL
#undef LTFAT_NAME_COMPLEX
#undef LTFAT_FFTW
#undef LTFAT_MX_CLASSID
#undef LTFAT_MX_COMPLEXITY
#undef LTFAT_COMPLEXH_NAME
/* -------- Define routines that do not change between single/double-- */
//LTFAT_EXTERN_NOTYPE
int gcd(const int a, const int b, int *r, int *s );
//LTFAT_EXTERN_NOTYPE
void* ltfat_malloc (size_t n);
//LTFAT_EXTERN_NOTYPE
void* ltfat_calloc (size_t nmemb, size_t size);
//LTFAT_EXTERN_NOTYPE
void* ltfat_realloc (void *ptr, size_t n);
//LTFAT_EXTERN_NOTYPE
void* ltfat_realloc_and_copy (void *ptr, size_t nold, size_t nnew);
//LTFAT_EXTERN_NOTYPE
void ltfat_free(void *ptr);
//LTFAT_EXTERN_NOTYPE
void fftindex(const int N, int *indexout);
//LTFAT_EXTERN_NOTYPE
int makelarger(const int L, const int K);
//LTFAT_EXTERN_NOTYPE
int int_max(const int a, const int b);
//LTFAT_EXTERN_NOTYPE
int int_min(const int a, const int b);
//LTFAT_EXTERN_NOTYPE
int lcm(const int a, const int b);
//LTFAT_EXTERN_NOTYPE
void gabimagepars(const int Ls, const int x, const int y,
int *a, int *M, int *L, int *N, int *Ngood);
//LTFAT_EXTERN_NOTYPE
int wfacreal_size(const int L, const int a, const int M);
size_t nextPow2_st(size_t x);
size_t nextfastfft(size_t x);
size_t max_st(const size_t a, const size_t b);
size_t min_st(const size_t a, const size_t b);
ptrdiff_t max_pt(const ptrdiff_t a, const ptrdiff_t b);
ptrdiff_t min_pt(const ptrdiff_t a, const ptrdiff_t b);
#ifdef __cplusplus
} // extern "C"
#endif
/* END_C_DECLS */
#endif /* !LTFAT_H */