Commit 759728f9 authored by Mert Burkay Çöteli's avatar Mert Burkay Çöteli
Browse files

initial commit for deployment

parent 53b7603f
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
#include "dft/dft.h"
#include "rdft/rdft.h"
#include "api/x77.h"
/* if F77_FUNC is not defined, then we don't know how to mangle identifiers
for the Fortran linker, and we must omit the f77 API. */
#if defined(F77_FUNC) || defined(WINDOWS_F77_MANGLING)
/*-----------------------------------------------------------------------*/
/* some internal functions used by the f77 api */
/* in fortran, the natural array ordering is column-major, which
corresponds to reversing the dimensions relative to C's row-major */
static int *reverse_n(int rnk, const int *n)
{
int *nrev;
int i;
A(FINITE_RNK(rnk));
nrev = (int *) MALLOC(sizeof(int) * (unsigned)rnk, PROBLEMS);
for (i = 0; i < rnk; ++i)
nrev[rnk - i - 1] = n[i];
return nrev;
}
/* f77 doesn't have data structures, so we have to pass iodims as
parallel arrays */
static X(iodim) *make_dims(int rnk, const int *n,
const int *is, const int *os)
{
X(iodim) *dims;
int i;
A(FINITE_RNK(rnk));
dims = (X(iodim) *) MALLOC(sizeof(X(iodim)) * (unsigned)rnk, PROBLEMS);
for (i = 0; i < rnk; ++i) {
dims[i].n = n[i];
dims[i].is = is[i];
dims[i].os = os[i];
}
return dims;
}
typedef struct {
void (*f77_write_char)(char *, void *);
void *data;
} write_char_data;
static void write_char(char c, void *d)
{
write_char_data *ad = (write_char_data *) d;
ad->f77_write_char(&c, ad->data);
}
typedef struct {
void (*f77_read_char)(int *, void *);
void *data;
} read_char_data;
static int read_char(void *d)
{
read_char_data *ed = (read_char_data *) d;
int c;
ed->f77_read_char(&c, ed->data);
return (c < 0 ? EOF : c);
}
static X(r2r_kind) *ints2kinds(int rnk, const int *ik)
{
if (!FINITE_RNK(rnk) || rnk == 0)
return 0;
else {
int i;
X(r2r_kind) *k;
k = (X(r2r_kind) *) MALLOC(sizeof(X(r2r_kind)) * (unsigned)rnk, PROBLEMS);
/* reverse order for Fortran -> C */
for (i = 0; i < rnk; ++i)
k[i] = (X(r2r_kind)) ik[rnk - 1 - i];
return k;
}
}
/*-----------------------------------------------------------------------*/
#define F77(a, A) F77x(x77(a), X77(A))
#ifndef WINDOWS_F77_MANGLING
#if defined(F77_FUNC)
# define F77x(a, A) F77_FUNC(a, A)
# include "f77funcs.h"
#endif
/* If identifiers with underscores are mangled differently than those
without underscores, then we include *both* mangling versions. The
reason is that the only Fortran compiler that does such differing
mangling is currently g77 (which adds an extra underscore to names
with underscores), whereas other compilers running on the same
machine are likely to use non-underscored mangling. (I'm sick
of users complaining that FFTW works with g77 but not with e.g.
pgf77 or ifc on the same machine.) Note that all FFTW identifiers
contain underscores, and configure picks g77 by default. */
#if defined(F77_FUNC_) && !defined(F77_FUNC_EQUIV)
# undef F77x
# define F77x(a, A) F77_FUNC_(a, A)
# include "f77funcs.h"
#endif
#else /* WINDOWS_F77_MANGLING */
/* Various mangling conventions common (?) under Windows. */
/* g77 */
# define WINDOWS_F77_FUNC(a, A) a ## __
# define F77x(a, A) WINDOWS_F77_FUNC(a, A)
# include "f77funcs.h"
/* Intel, etc. */
# undef WINDOWS_F77_FUNC
# define WINDOWS_F77_FUNC(a, A) a ## _
# include "f77funcs.h"
/* Digital/Compaq/HP Visual Fortran, Intel Fortran. stdcall attribute
is apparently required to adjust for calling conventions (callee
pops stack in stdcall). See also:
http://msdn.microsoft.com/library/en-us/vccore98/html/_core_mixed.2d.language_programming.3a_.overview.asp
*/
# undef WINDOWS_F77_FUNC
# if defined(__GNUC__)
# define WINDOWS_F77_FUNC(a, A) __attribute__((stdcall)) A
# elif defined(_MSC_VER) || defined(_ICC) || defined(_STDCALL_SUPPORTED)
# define WINDOWS_F77_FUNC(a, A) __stdcall A
# else
# define WINDOWS_F77_FUNC(a, A) A /* oh well */
# endif
# include "f77funcs.h"
#endif /* WINDOWS_F77_MANGLING */
#endif /* F77_FUNC */
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* Functions in the FFTW Fortran API, mangled according to the
F77(...) macro. This file is designed to be #included by
f77api.c, possibly multiple times in order to support multiple
compiler manglings (via redefinition of F77). */
FFTW_VOIDFUNC F77(execute, EXECUTE)(X(plan) * const p)
{
plan *pln = (*p)->pln;
pln->adt->solve(pln, (*p)->prb);
}
FFTW_VOIDFUNC F77(destroy_plan, DESTROY_PLAN)(X(plan) *p)
{
X(destroy_plan)(*p);
}
FFTW_VOIDFUNC F77(cleanup, CLEANUP)(void)
{
X(cleanup)();
}
FFTW_VOIDFUNC F77(forget_wisdom, FORGET_WISDOM)(void)
{
X(forget_wisdom)();
}
FFTW_VOIDFUNC F77(export_wisdom, EXPORT_WISDOM)(void (*f77_write_char)(char *, void *),
void *data)
{
write_char_data ad;
ad.f77_write_char = f77_write_char;
ad.data = data;
X(export_wisdom)(write_char, (void *) &ad);
}
FFTW_VOIDFUNC F77(import_wisdom, IMPORT_WISDOM)(int *isuccess,
void (*f77_read_char)(int *, void *),
void *data)
{
read_char_data ed;
ed.f77_read_char = f77_read_char;
ed.data = data;
*isuccess = X(import_wisdom)(read_char, (void *) &ed);
}
FFTW_VOIDFUNC F77(import_system_wisdom, IMPORT_SYSTEM_WISDOM)(int *isuccess)
{
*isuccess = X(import_system_wisdom)();
}
FFTW_VOIDFUNC F77(print_plan, PRINT_PLAN)(X(plan) * const p)
{
X(print_plan)(*p);
fflush(stdout);
}
FFTW_VOIDFUNC F77(flops,FLOPS)(X(plan) *p, double *add, double *mul, double *fma)
{
X(flops)(*p, add, mul, fma);
}
FFTW_VOIDFUNC F77(estimate_cost,ESTIMATE_COST)(double *cost, X(plan) * const p)
{
*cost = X(estimate_cost)(*p);
}
FFTW_VOIDFUNC F77(cost,COST)(double *cost, X(plan) * const p)
{
*cost = X(cost)(*p);
}
FFTW_VOIDFUNC F77(set_timelimit,SET_TIMELIMIT)(double *t)
{
X(set_timelimit)(*t);
}
/******************************** DFT ***********************************/
FFTW_VOIDFUNC F77(plan_dft, PLAN_DFT)(X(plan) *p, int *rank, const int *n,
C *in, C *out, int *sign, int *flags)
{
int *nrev = reverse_n(*rank, n);
*p = X(plan_dft)(*rank, nrev, in, out, *sign, *flags);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_dft_1d, PLAN_DFT_1D)(X(plan) *p, int *n, C *in, C *out,
int *sign, int *flags)
{
*p = X(plan_dft_1d)(*n, in, out, *sign, *flags);
}
FFTW_VOIDFUNC F77(plan_dft_2d, PLAN_DFT_2D)(X(plan) *p, int *nx, int *ny,
C *in, C *out, int *sign, int *flags)
{
*p = X(plan_dft_2d)(*ny, *nx, in, out, *sign, *flags);
}
FFTW_VOIDFUNC F77(plan_dft_3d, PLAN_DFT_3D)(X(plan) *p, int *nx, int *ny, int *nz,
C *in, C *out,
int *sign, int *flags)
{
*p = X(plan_dft_3d)(*nz, *ny, *nx, in, out, *sign, *flags);
}
FFTW_VOIDFUNC F77(plan_many_dft, PLAN_MANY_DFT)(X(plan) *p, int *rank, const int *n,
int *howmany,
C *in, const int *inembed,
int *istride, int *idist,
C *out, const int *onembed,
int *ostride, int *odist,
int *sign, int *flags)
{
int *nrev = reverse_n(*rank, n);
int *inembedrev = reverse_n(*rank, inembed);
int *onembedrev = reverse_n(*rank, onembed);
*p = X(plan_many_dft)(*rank, nrev, *howmany,
in, inembedrev, *istride, *idist,
out, onembedrev, *ostride, *odist,
*sign, *flags);
X(ifree0)(onembedrev);
X(ifree0)(inembedrev);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_guru_dft, PLAN_GURU_DFT)(X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
C *in, C *out, int *sign, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
*p = X(plan_guru_dft)(*rank, dims, *howmany_rank, howmany_dims,
in, out, *sign, *flags);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(plan_guru_split_dft, PLAN_GURU_SPLIT_DFT)(X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
R *ri, R *ii, R *ro, R *io, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
*p = X(plan_guru_split_dft)(*rank, dims, *howmany_rank, howmany_dims,
ri, ii, ro, io, *flags);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(execute_dft, EXECUTE_DFT)(X(plan) * const p, C *in, C *out)
{
plan_dft *pln = (plan_dft *) (*p)->pln;
if ((*p)->sign == FFT_SIGN)
pln->apply((plan *) pln, in[0], in[0]+1, out[0], out[0]+1);
else
pln->apply((plan *) pln, in[0]+1, in[0], out[0]+1, out[0]);
}
FFTW_VOIDFUNC F77(execute_split_dft, EXECUTE_SPLIT_DFT)(X(plan) * const p,
R *ri, R *ii, R *ro, R *io)
{
plan_dft *pln = (plan_dft *) (*p)->pln;
pln->apply((plan *) pln, ri, ii, ro, io);
}
/****************************** DFT r2c *********************************/
FFTW_VOIDFUNC F77(plan_dft_r2c, PLAN_DFT_R2C)(X(plan) *p, int *rank, const int *n,
R *in, C *out, int *flags)
{
int *nrev = reverse_n(*rank, n);
*p = X(plan_dft_r2c)(*rank, nrev, in, out, *flags);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_dft_r2c_1d, PLAN_DFT_R2C_1D)(X(plan) *p, int *n, R *in, C *out,
int *flags)
{
*p = X(plan_dft_r2c_1d)(*n, in, out, *flags);
}
FFTW_VOIDFUNC F77(plan_dft_r2c_2d, PLAN_DFT_R2C_2D)(X(plan) *p, int *nx, int *ny,
R *in, C *out, int *flags)
{
*p = X(plan_dft_r2c_2d)(*ny, *nx, in, out, *flags);
}
FFTW_VOIDFUNC F77(plan_dft_r2c_3d, PLAN_DFT_R2C_3D)(X(plan) *p,
int *nx, int *ny, int *nz,
R *in, C *out,
int *flags)
{
*p = X(plan_dft_r2c_3d)(*nz, *ny, *nx, in, out, *flags);
}
FFTW_VOIDFUNC F77(plan_many_dft_r2c, PLAN_MANY_DFT_R2C)(
X(plan) *p, int *rank, const int *n,
int *howmany,
R *in, const int *inembed, int *istride, int *idist,
C *out, const int *onembed, int *ostride, int *odist,
int *flags)
{
int *nrev = reverse_n(*rank, n);
int *inembedrev = reverse_n(*rank, inembed);
int *onembedrev = reverse_n(*rank, onembed);
*p = X(plan_many_dft_r2c)(*rank, nrev, *howmany,
in, inembedrev, *istride, *idist,
out, onembedrev, *ostride, *odist,
*flags);
X(ifree0)(onembedrev);
X(ifree0)(inembedrev);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_guru_dft_r2c, PLAN_GURU_DFT_R2C)(
X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
R *in, C *out, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
*p = X(plan_guru_dft_r2c)(*rank, dims, *howmany_rank, howmany_dims,
in, out, *flags);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(plan_guru_split_dft_r2c, PLAN_GURU_SPLIT_DFT_R2C)(
X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
R *in, R *ro, R *io, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
*p = X(plan_guru_split_dft_r2c)(*rank, dims, *howmany_rank, howmany_dims,
in, ro, io, *flags);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(execute_dft_r2c, EXECUTE_DFT_R2C)(X(plan) * const p, R *in, C *out)
{
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
problem_rdft2 *prb = (problem_rdft2 *) (*p)->prb;
pln->apply((plan *) pln, in, in + (prb->r1 - prb->r0), out[0], out[0]+1);
}
FFTW_VOIDFUNC F77(execute_split_dft_r2c, EXECUTE_SPLIT_DFT_R2C)(X(plan) * const p,
R *in, R *ro, R *io)
{
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
problem_rdft2 *prb = (problem_rdft2 *) (*p)->prb;
pln->apply((plan *) pln, in, in + (prb->r1 - prb->r0), ro, io);
}
/****************************** DFT c2r *********************************/
FFTW_VOIDFUNC F77(plan_dft_c2r, PLAN_DFT_C2R)(X(plan) *p, int *rank, const int *n,
C *in, R *out, int *flags)
{
int *nrev = reverse_n(*rank, n);
*p = X(plan_dft_c2r)(*rank, nrev, in, out, *flags);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_dft_c2r_1d, PLAN_DFT_C2R_1D)(X(plan) *p, int *n, C *in, R *out,
int *flags)
{
*p = X(plan_dft_c2r_1d)(*n, in, out, *flags);
}
FFTW_VOIDFUNC F77(plan_dft_c2r_2d, PLAN_DFT_C2R_2D)(X(plan) *p, int *nx, int *ny,
C *in, R *out, int *flags)
{
*p = X(plan_dft_c2r_2d)(*ny, *nx, in, out, *flags);
}
FFTW_VOIDFUNC F77(plan_dft_c2r_3d, PLAN_DFT_C2R_3D)(X(plan) *p,
int *nx, int *ny, int *nz,
C *in, R *out,
int *flags)
{
*p = X(plan_dft_c2r_3d)(*nz, *ny, *nx, in, out, *flags);
}
FFTW_VOIDFUNC F77(plan_many_dft_c2r, PLAN_MANY_DFT_C2R)(
X(plan) *p, int *rank, const int *n,
int *howmany,
C *in, const int *inembed, int *istride, int *idist,
R *out, const int *onembed, int *ostride, int *odist,
int *flags)
{
int *nrev = reverse_n(*rank, n);
int *inembedrev = reverse_n(*rank, inembed);
int *onembedrev = reverse_n(*rank, onembed);
*p = X(plan_many_dft_c2r)(*rank, nrev, *howmany,
in, inembedrev, *istride, *idist,
out, onembedrev, *ostride, *odist,
*flags);
X(ifree0)(onembedrev);
X(ifree0)(inembedrev);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_guru_dft_c2r, PLAN_GURU_DFT_C2R)(
X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
C *in, R *out, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
*p = X(plan_guru_dft_c2r)(*rank, dims, *howmany_rank, howmany_dims,
in, out, *flags);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(plan_guru_split_dft_c2r, PLAN_GURU_SPLIT_DFT_C2R)(
X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
R *ri, R *ii, R *out, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
*p = X(plan_guru_split_dft_c2r)(*rank, dims, *howmany_rank, howmany_dims,
ri, ii, out, *flags);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(execute_dft_c2r, EXECUTE_DFT_C2R)(X(plan) * const p, C *in, R *out)
{
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
problem_rdft2 *prb = (problem_rdft2 *) (*p)->prb;
pln->apply((plan *) pln, out, out + (prb->r1 - prb->r0), in[0], in[0]+1);
}
FFTW_VOIDFUNC F77(execute_split_dft_c2r, EXECUTE_SPLIT_DFT_C2R)(X(plan) * const p,
R *ri, R *ii, R *out)
{
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
problem_rdft2 *prb = (problem_rdft2 *) (*p)->prb;
pln->apply((plan *) pln, out, out + (prb->r1 - prb->r0), ri, ii);
}
/****************************** r2r *********************************/
FFTW_VOIDFUNC F77(plan_r2r, PLAN_R2R)(X(plan) *p, int *rank, const int *n,
R *in, R *out,
int *kind, int *flags)
{
int *nrev = reverse_n(*rank, n);
X(r2r_kind) *k = ints2kinds(*rank, kind);
*p = X(plan_r2r)(*rank, nrev, in, out, k, *flags);
X(ifree0)(k);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_r2r_1d, PLAN_R2R_1D)(X(plan) *p, int *n, R *in, R *out,
int *kind, int *flags)
{
*p = X(plan_r2r_1d)(*n, in, out, (X(r2r_kind)) *kind, *flags);
}
FFTW_VOIDFUNC F77(plan_r2r_2d, PLAN_R2R_2D)(X(plan) *p, int *nx, int *ny,
R *in, R *out,
int *kindx, int *kindy, int *flags)
{
*p = X(plan_r2r_2d)(*ny, *nx, in, out,
(X(r2r_kind)) *kindy, (X(r2r_kind)) *kindx, *flags);
}
FFTW_VOIDFUNC F77(plan_r2r_3d, PLAN_R2R_3D)(X(plan) *p,
int *nx, int *ny, int *nz,
R *in, R *out,
int *kindx, int *kindy, int *kindz,
int *flags)
{
*p = X(plan_r2r_3d)(*nz, *ny, *nx, in, out,
(X(r2r_kind)) *kindz, (X(r2r_kind)) *kindy,
(X(r2r_kind)) *kindx, *flags);
}
FFTW_VOIDFUNC F77(plan_many_r2r, PLAN_MANY_R2R)(
X(plan) *p, int *rank, const int *n,
int *howmany,
R *in, const int *inembed, int *istride, int *idist,
R *out, const int *onembed, int *ostride, int *odist,
int *kind, int *flags)
{
int *nrev = reverse_n(*rank, n);
int *inembedrev = reverse_n(*rank, inembed);
int *onembedrev = reverse_n(*rank, onembed);
X(r2r_kind) *k = ints2kinds(*rank, kind);
*p = X(plan_many_r2r)(*rank, nrev, *howmany,
in, inembedrev, *istride, *idist,
out, onembedrev, *ostride, *odist,
k, *flags);
X(ifree0)(k);
X(ifree0)(onembedrev);
X(ifree0)(inembedrev);
X(ifree0)(nrev);
}
FFTW_VOIDFUNC F77(plan_guru_r2r, PLAN_GURU_R2R)(
X(plan) *p, int *rank, const int *n,
const int *is, const int *os,
int *howmany_rank, const int *h_n,
const int *h_is, const int *h_os,
R *in, R *out, int *kind, int *flags)
{
X(iodim) *dims = make_dims(*rank, n, is, os);
X(iodim) *howmany_dims = make_dims(*howmany_rank, h_n, h_is, h_os);
X(r2r_kind) *k = ints2kinds(*rank, kind);
*p = X(plan_guru_r2r)(*rank, dims, *howmany_rank, howmany_dims,
in, out, k, *flags);
X(ifree0)(k);
X(ifree0)(howmany_dims);
X(ifree0)(dims);
}
FFTW_VOIDFUNC F77(execute_r2r, EXECUTE_R2R)(X(plan) * const p, R *in, R *out)
{
plan_rdft *pln = (plan_rdft *) (*p)->pln;
pln->apply((plan *) pln, in, out);
}
INTEGER FFTW_R2HC
PARAMETER (FFTW_R2HC=0)
INTEGER FFTW_HC2R
PARAMETER (FFTW_HC2R=1)
INTEGER FFTW_DHT
PARAMETER (FFTW_DHT=2)
INTEGER FFTW_REDFT00
PARAMETER (FFTW_REDFT00=3)
INTEGER FFTW_REDFT01
PARAMETER (FFTW_REDFT01=4)
INTEGER FFTW_REDFT10
PARAMETER (FFTW_REDFT10=5)
INTEGER FFTW_REDFT11
PARAMETER (FFTW_REDFT11=6)
INTEGER FFTW_RODFT00
PARAMETER (FFTW_RODFT00=7)
INTEGER FFTW_RODFT01
PARAMETER (FFTW_RODFT01=8)
INTEGER FFTW_RODFT10
PARAMETER (FFTW_RODFT10=9)
INTEGER FFTW_RODFT11
PARAMETER (FFTW_RODFT11=10)
INTEGER FFTW_FORWARD
PARAMETER (FFTW_FORWARD=-1)
INTEGER FFTW_BACKWARD
PARAMETER (FFTW_BACKWARD=+1)
INTEGER FFTW_MEASURE
PARAMETER (FFTW_MEASURE=0)
INTEGER FFTW_DESTROY_INPUT
PARAMETER (FFTW_DESTROY_INPUT=1)
INTEGER FFTW_UNALIGNED
PARAMETER (FFTW_UNALIGNED=2)
INTEGER FFTW_CONSERVE_MEMORY
PARAMETER (FFTW_CONSERVE_MEMORY=4)
INTEGER FFTW_EXHAUSTIVE
PARAMETER (FFTW_EXHAUSTIVE=8)
INTEGER FFTW_PRESERVE_INPUT
PARAMETER (FFTW_PRESERVE_INPUT=16)
INTEGER FFTW_PATIENT
PARAMETER (FFTW_PATIENT=32)
INTEGER FFTW_ESTIMATE
PARAMETER (FFTW_ESTIMATE=64)
INTEGER FFTW_WISDOM_ONLY
PARAMETER (FFTW_WISDOM_ONLY=2097152)
INTEGER FFTW_ESTIMATE_PATIENT
PARAMETER (FFTW_ESTIMATE_PATIENT=128)
INTEGER FFTW_BELIEVE_PCOST
PARAMETER (FFTW_BELIEVE_PCOST=256)
INTEGER FFTW_NO_DFT_R2HC
PARAMETER (FFTW_NO_DFT_R2HC=512)
INTEGER FFTW_NO_NONTHREADED
PARAMETER (FFTW_NO_NONTHREADED=1024)
INTEGER FFTW_NO_BUFFERING
PARAMETER (FFTW_NO_BUFFERING=2048)
INTEGER FFTW_NO_INDIRECT_OP
PARAMETER (FFTW_NO_INDIRECT_OP=4096)
INTEGER FFTW_ALLOW_LARGE_GENERIC
PARAMETER (FFTW_ALLOW_LARGE_GENERIC=8192)
INTEGER FFTW_NO_RANK_SPLITS
PARAMETER (FFTW_NO_RANK_SPLITS=16384)
INTEGER FFTW_NO_VRANK_SPLITS
PARAMETER (FFTW_NO_VRANK_SPLITS=32768)
INTEGER FFTW_NO_VRECURSE
PARAMETER (FFTW_NO_VRECURSE=65536)
INTEGER FFTW_NO_SIMD
PARAMETER (FFTW_NO_SIMD=131072)
INTEGER FFTW_NO_SLOW
PARAMETER (FFTW_NO_SLOW=262144)
INTEGER FFTW_NO_FIXED_RADIX_LARGE_N
PARAMETER (FFTW_NO_FIXED_RADIX_LARGE_N=524288)
INTEGER FFTW_ALLOW_PRUNING
PARAMETER (FFTW_ALLOW_PRUNING=1048576)
! Generated automatically. DO NOT EDIT!
integer(C_INT), parameter :: FFTW_R2HC = 0
integer(C_INT), parameter :: FFTW_HC2R = 1
integer(C_INT), parameter :: FFTW_DHT = 2
integer(C_INT), parameter :: FFTW_REDFT00 = 3
integer(C_INT), parameter :: FFTW_REDFT01 = 4
integer(C_INT), parameter :: FFTW_REDFT10 = 5
integer(C_INT), parameter :: FFTW_REDFT11 = 6
integer(C_INT), parameter :: FFTW_RODFT00 = 7
integer(C_INT), parameter :: FFTW_RODFT01 = 8
integer(C_INT), parameter :: FFTW_RODFT10 = 9
integer(C_INT), parameter :: FFTW_RODFT11 = 10
integer(C_INT), parameter :: FFTW_FORWARD = -1
integer(C_INT), parameter :: FFTW_BACKWARD = +1
integer(C_INT), parameter :: FFTW_MEASURE = 0
integer(C_INT), parameter :: FFTW_DESTROY_INPUT = 1
integer(C_INT), parameter :: FFTW_UNALIGNED = 2
integer(C_INT), parameter :: FFTW_CONSERVE_MEMORY = 4
integer(C_INT), parameter :: FFTW_EXHAUSTIVE = 8
integer(C_INT), parameter :: FFTW_PRESERVE_INPUT = 16
integer(C_INT), parameter :: FFTW_PATIENT = 32
integer(C_INT), parameter :: FFTW_ESTIMATE = 64
integer(C_INT), parameter :: FFTW_WISDOM_ONLY = 2097152
integer(C_INT), parameter :: FFTW_ESTIMATE_PATIENT = 128
integer(C_INT), parameter :: FFTW_BELIEVE_PCOST = 256
integer(C_INT), parameter :: FFTW_NO_DFT_R2HC = 512
integer(C_INT), parameter :: FFTW_NO_NONTHREADED = 1024
integer(C_INT), parameter :: FFTW_NO_BUFFERING = 2048
integer(C_INT), parameter :: FFTW_NO_INDIRECT_OP = 4096
integer(C_INT), parameter :: FFTW_ALLOW_LARGE_GENERIC = 8192
integer(C_INT), parameter :: FFTW_NO_RANK_SPLITS = 16384
integer(C_INT), parameter :: FFTW_NO_VRANK_SPLITS = 32768
integer(C_INT), parameter :: FFTW_NO_VRECURSE = 65536
integer(C_INT), parameter :: FFTW_NO_SIMD = 131072
integer(C_INT), parameter :: FFTW_NO_SLOW = 262144
integer(C_INT), parameter :: FFTW_NO_FIXED_RADIX_LARGE_N = 524288
integer(C_INT), parameter :: FFTW_ALLOW_PRUNING = 1048576
type, bind(C) :: fftw_iodim
integer(C_INT) n, is, os
end type fftw_iodim
type, bind(C) :: fftw_iodim64
integer(C_INTPTR_T) n, is, os
end type fftw_iodim64
interface
type(C_PTR) function fftw_plan_dft(rank,n,in,out,sign,flags) bind(C, name='fftw_plan_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_dft
type(C_PTR) function fftw_plan_dft_1d(n,in,out,sign,flags) bind(C, name='fftw_plan_dft_1d')
import
integer(C_INT), value :: n
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_dft_1d
type(C_PTR) function fftw_plan_dft_2d(n0,n1,in,out,sign,flags) bind(C, name='fftw_plan_dft_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_dft_2d
type(C_PTR) function fftw_plan_dft_3d(n0,n1,n2,in,out,sign,flags) bind(C, name='fftw_plan_dft_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_dft_3d
type(C_PTR) function fftw_plan_many_dft(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,sign,flags) &
bind(C, name='fftw_plan_many_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_many_dft
type(C_PTR) function fftw_plan_guru_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftw_plan_guru_dft')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_guru_dft
type(C_PTR) function fftw_plan_guru_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftw_plan_guru_split_dft')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: ri
real(C_DOUBLE), dimension(*), intent(out) :: ii
real(C_DOUBLE), dimension(*), intent(out) :: ro
real(C_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftw_plan_guru_split_dft
type(C_PTR) function fftw_plan_guru64_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftw_plan_guru64_dft')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftw_plan_guru64_dft
type(C_PTR) function fftw_plan_guru64_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftw_plan_guru64_split_dft')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: ri
real(C_DOUBLE), dimension(*), intent(out) :: ii
real(C_DOUBLE), dimension(*), intent(out) :: ro
real(C_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftw_plan_guru64_split_dft
subroutine fftw_execute_dft(p,in,out) bind(C, name='fftw_execute_dft')
import
type(C_PTR), value :: p
complex(C_DOUBLE_COMPLEX), dimension(*), intent(inout) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
end subroutine fftw_execute_dft
subroutine fftw_execute_split_dft(p,ri,ii,ro,io) bind(C, name='fftw_execute_split_dft')
import
type(C_PTR), value :: p
real(C_DOUBLE), dimension(*), intent(inout) :: ri
real(C_DOUBLE), dimension(*), intent(inout) :: ii
real(C_DOUBLE), dimension(*), intent(out) :: ro
real(C_DOUBLE), dimension(*), intent(out) :: io
end subroutine fftw_execute_split_dft
type(C_PTR) function fftw_plan_many_dft_r2c(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftw_plan_many_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(C_DOUBLE), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftw_plan_many_dft_r2c
type(C_PTR) function fftw_plan_dft_r2c(rank,n,in,out,flags) bind(C, name='fftw_plan_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(C_DOUBLE), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_r2c
type(C_PTR) function fftw_plan_dft_r2c_1d(n,in,out,flags) bind(C, name='fftw_plan_dft_r2c_1d')
import
integer(C_INT), value :: n
real(C_DOUBLE), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_r2c_1d
type(C_PTR) function fftw_plan_dft_r2c_2d(n0,n1,in,out,flags) bind(C, name='fftw_plan_dft_r2c_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(C_DOUBLE), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_r2c_2d
type(C_PTR) function fftw_plan_dft_r2c_3d(n0,n1,n2,in,out,flags) bind(C, name='fftw_plan_dft_r2c_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(C_DOUBLE), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_r2c_3d
type(C_PTR) function fftw_plan_many_dft_c2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftw_plan_many_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftw_plan_many_dft_c2r
type(C_PTR) function fftw_plan_dft_c2r(rank,n,in,out,flags) bind(C, name='fftw_plan_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_c2r
type(C_PTR) function fftw_plan_dft_c2r_1d(n,in,out,flags) bind(C, name='fftw_plan_dft_c2r_1d')
import
integer(C_INT), value :: n
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_c2r_1d
type(C_PTR) function fftw_plan_dft_c2r_2d(n0,n1,in,out,flags) bind(C, name='fftw_plan_dft_c2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_c2r_2d
type(C_PTR) function fftw_plan_dft_c2r_3d(n0,n1,n2,in,out,flags) bind(C, name='fftw_plan_dft_c2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_dft_c2r_3d
type(C_PTR) function fftw_plan_guru_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftw_plan_guru_dft_r2c')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_guru_dft_r2c
type(C_PTR) function fftw_plan_guru_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftw_plan_guru_dft_c2r')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_guru_dft_c2r
type(C_PTR) function fftw_plan_guru_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftw_plan_guru_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: ro
real(C_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftw_plan_guru_split_dft_r2c
type(C_PTR) function fftw_plan_guru_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftw_plan_guru_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: ri
real(C_DOUBLE), dimension(*), intent(out) :: ii
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_guru_split_dft_c2r
type(C_PTR) function fftw_plan_guru64_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftw_plan_guru64_dft_r2c')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_guru64_dft_r2c
type(C_PTR) function fftw_plan_guru64_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftw_plan_guru64_dft_c2r')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_guru64_dft_c2r
type(C_PTR) function fftw_plan_guru64_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftw_plan_guru64_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: ro
real(C_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftw_plan_guru64_split_dft_r2c
type(C_PTR) function fftw_plan_guru64_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftw_plan_guru64_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: ri
real(C_DOUBLE), dimension(*), intent(out) :: ii
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftw_plan_guru64_split_dft_c2r
subroutine fftw_execute_dft_r2c(p,in,out) bind(C, name='fftw_execute_dft_r2c')
import
type(C_PTR), value :: p
real(C_DOUBLE), dimension(*), intent(inout) :: in
complex(C_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
end subroutine fftw_execute_dft_r2c
subroutine fftw_execute_dft_c2r(p,in,out) bind(C, name='fftw_execute_dft_c2r')
import
type(C_PTR), value :: p
complex(C_DOUBLE_COMPLEX), dimension(*), intent(inout) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
end subroutine fftw_execute_dft_c2r
subroutine fftw_execute_split_dft_r2c(p,in,ro,io) bind(C, name='fftw_execute_split_dft_r2c')
import
type(C_PTR), value :: p
real(C_DOUBLE), dimension(*), intent(inout) :: in
real(C_DOUBLE), dimension(*), intent(out) :: ro
real(C_DOUBLE), dimension(*), intent(out) :: io
end subroutine fftw_execute_split_dft_r2c
subroutine fftw_execute_split_dft_c2r(p,ri,ii,out) bind(C, name='fftw_execute_split_dft_c2r')
import
type(C_PTR), value :: p
real(C_DOUBLE), dimension(*), intent(inout) :: ri
real(C_DOUBLE), dimension(*), intent(inout) :: ii
real(C_DOUBLE), dimension(*), intent(out) :: out
end subroutine fftw_execute_split_dft_c2r
type(C_PTR) function fftw_plan_many_r2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,kind,flags) &
bind(C, name='fftw_plan_many_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(C_DOUBLE), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftw_plan_many_r2r
type(C_PTR) function fftw_plan_r2r(rank,n,in,out,kind,flags) bind(C, name='fftw_plan_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftw_plan_r2r
type(C_PTR) function fftw_plan_r2r_1d(n,in,out,kind,flags) bind(C, name='fftw_plan_r2r_1d')
import
integer(C_INT), value :: n
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind
integer(C_INT), value :: flags
end function fftw_plan_r2r_1d
type(C_PTR) function fftw_plan_r2r_2d(n0,n1,in,out,kind0,kind1,flags) bind(C, name='fftw_plan_r2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_INT), value :: flags
end function fftw_plan_r2r_2d
type(C_PTR) function fftw_plan_r2r_3d(n0,n1,n2,in,out,kind0,kind1,kind2,flags) bind(C, name='fftw_plan_r2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_FFTW_R2R_KIND), value :: kind2
integer(C_INT), value :: flags
end function fftw_plan_r2r_3d
type(C_PTR) function fftw_plan_guru_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftw_plan_guru_r2r')
import
integer(C_INT), value :: rank
type(fftw_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftw_plan_guru_r2r
type(C_PTR) function fftw_plan_guru64_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftw_plan_guru64_r2r')
import
integer(C_INT), value :: rank
type(fftw_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftw_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_DOUBLE), dimension(*), intent(out) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftw_plan_guru64_r2r
subroutine fftw_execute_r2r(p,in,out) bind(C, name='fftw_execute_r2r')
import
type(C_PTR), value :: p
real(C_DOUBLE), dimension(*), intent(inout) :: in
real(C_DOUBLE), dimension(*), intent(out) :: out
end subroutine fftw_execute_r2r
subroutine fftw_destroy_plan(p) bind(C, name='fftw_destroy_plan')
import
type(C_PTR), value :: p
end subroutine fftw_destroy_plan
subroutine fftw_forget_wisdom() bind(C, name='fftw_forget_wisdom')
import
end subroutine fftw_forget_wisdom
subroutine fftw_cleanup() bind(C, name='fftw_cleanup')
import
end subroutine fftw_cleanup
subroutine fftw_set_timelimit(t) bind(C, name='fftw_set_timelimit')
import
real(C_DOUBLE), value :: t
end subroutine fftw_set_timelimit
subroutine fftw_plan_with_nthreads(nthreads) bind(C, name='fftw_plan_with_nthreads')
import
integer(C_INT), value :: nthreads
end subroutine fftw_plan_with_nthreads
integer(C_INT) function fftw_planner_nthreads() bind(C, name='fftw_planner_nthreads')
import
end function fftw_planner_nthreads
integer(C_INT) function fftw_init_threads() bind(C, name='fftw_init_threads')
import
end function fftw_init_threads
subroutine fftw_cleanup_threads() bind(C, name='fftw_cleanup_threads')
import
end subroutine fftw_cleanup_threads
! Unable to generate Fortran interface for fftw_threads_set_callback
subroutine fftw_make_planner_thread_safe() bind(C, name='fftw_make_planner_thread_safe')
import
end subroutine fftw_make_planner_thread_safe
integer(C_INT) function fftw_export_wisdom_to_filename(filename) bind(C, name='fftw_export_wisdom_to_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftw_export_wisdom_to_filename
subroutine fftw_export_wisdom_to_file(output_file) bind(C, name='fftw_export_wisdom_to_file')
import
type(C_PTR), value :: output_file
end subroutine fftw_export_wisdom_to_file
type(C_PTR) function fftw_export_wisdom_to_string() bind(C, name='fftw_export_wisdom_to_string')
import
end function fftw_export_wisdom_to_string
subroutine fftw_export_wisdom(write_char,data) bind(C, name='fftw_export_wisdom')
import
type(C_FUNPTR), value :: write_char
type(C_PTR), value :: data
end subroutine fftw_export_wisdom
integer(C_INT) function fftw_import_system_wisdom() bind(C, name='fftw_import_system_wisdom')
import
end function fftw_import_system_wisdom
integer(C_INT) function fftw_import_wisdom_from_filename(filename) bind(C, name='fftw_import_wisdom_from_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftw_import_wisdom_from_filename
integer(C_INT) function fftw_import_wisdom_from_file(input_file) bind(C, name='fftw_import_wisdom_from_file')
import
type(C_PTR), value :: input_file
end function fftw_import_wisdom_from_file
integer(C_INT) function fftw_import_wisdom_from_string(input_string) bind(C, name='fftw_import_wisdom_from_string')
import
character(C_CHAR), dimension(*), intent(in) :: input_string
end function fftw_import_wisdom_from_string
integer(C_INT) function fftw_import_wisdom(read_char,data) bind(C, name='fftw_import_wisdom')
import
type(C_FUNPTR), value :: read_char
type(C_PTR), value :: data
end function fftw_import_wisdom
subroutine fftw_fprint_plan(p,output_file) bind(C, name='fftw_fprint_plan')
import
type(C_PTR), value :: p
type(C_PTR), value :: output_file
end subroutine fftw_fprint_plan
subroutine fftw_print_plan(p) bind(C, name='fftw_print_plan')
import
type(C_PTR), value :: p
end subroutine fftw_print_plan
type(C_PTR) function fftw_sprint_plan(p) bind(C, name='fftw_sprint_plan')
import
type(C_PTR), value :: p
end function fftw_sprint_plan
type(C_PTR) function fftw_malloc(n) bind(C, name='fftw_malloc')
import
integer(C_SIZE_T), value :: n
end function fftw_malloc
type(C_PTR) function fftw_alloc_real(n) bind(C, name='fftw_alloc_real')
import
integer(C_SIZE_T), value :: n
end function fftw_alloc_real
type(C_PTR) function fftw_alloc_complex(n) bind(C, name='fftw_alloc_complex')
import
integer(C_SIZE_T), value :: n
end function fftw_alloc_complex
subroutine fftw_free(p) bind(C, name='fftw_free')
import
type(C_PTR), value :: p
end subroutine fftw_free
subroutine fftw_flops(p,add,mul,fmas) bind(C, name='fftw_flops')
import
type(C_PTR), value :: p
real(C_DOUBLE), intent(out) :: add
real(C_DOUBLE), intent(out) :: mul
real(C_DOUBLE), intent(out) :: fmas
end subroutine fftw_flops
real(C_DOUBLE) function fftw_estimate_cost(p) bind(C, name='fftw_estimate_cost')
import
type(C_PTR), value :: p
end function fftw_estimate_cost
real(C_DOUBLE) function fftw_cost(p) bind(C, name='fftw_cost')
import
type(C_PTR), value :: p
end function fftw_cost
integer(C_INT) function fftw_alignment_of(p) bind(C, name='fftw_alignment_of')
import
real(C_DOUBLE), dimension(*), intent(out) :: p
end function fftw_alignment_of
end interface
type, bind(C) :: fftwf_iodim
integer(C_INT) n, is, os
end type fftwf_iodim
type, bind(C) :: fftwf_iodim64
integer(C_INTPTR_T) n, is, os
end type fftwf_iodim64
interface
type(C_PTR) function fftwf_plan_dft(rank,n,in,out,sign,flags) bind(C, name='fftwf_plan_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_dft
type(C_PTR) function fftwf_plan_dft_1d(n,in,out,sign,flags) bind(C, name='fftwf_plan_dft_1d')
import
integer(C_INT), value :: n
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_dft_1d
type(C_PTR) function fftwf_plan_dft_2d(n0,n1,in,out,sign,flags) bind(C, name='fftwf_plan_dft_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_dft_2d
type(C_PTR) function fftwf_plan_dft_3d(n0,n1,n2,in,out,sign,flags) bind(C, name='fftwf_plan_dft_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_dft_3d
type(C_PTR) function fftwf_plan_many_dft(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,sign,flags) &
bind(C, name='fftwf_plan_many_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_many_dft
type(C_PTR) function fftwf_plan_guru_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftwf_plan_guru_dft')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_guru_dft
type(C_PTR) function fftwf_plan_guru_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftwf_plan_guru_split_dft')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: ri
real(C_FLOAT), dimension(*), intent(out) :: ii
real(C_FLOAT), dimension(*), intent(out) :: ro
real(C_FLOAT), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwf_plan_guru_split_dft
type(C_PTR) function fftwf_plan_guru64_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftwf_plan_guru64_dft')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwf_plan_guru64_dft
type(C_PTR) function fftwf_plan_guru64_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftwf_plan_guru64_split_dft')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: ri
real(C_FLOAT), dimension(*), intent(out) :: ii
real(C_FLOAT), dimension(*), intent(out) :: ro
real(C_FLOAT), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwf_plan_guru64_split_dft
subroutine fftwf_execute_dft(p,in,out) bind(C, name='fftwf_execute_dft')
import
type(C_PTR), value :: p
complex(C_FLOAT_COMPLEX), dimension(*), intent(inout) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
end subroutine fftwf_execute_dft
subroutine fftwf_execute_split_dft(p,ri,ii,ro,io) bind(C, name='fftwf_execute_split_dft')
import
type(C_PTR), value :: p
real(C_FLOAT), dimension(*), intent(inout) :: ri
real(C_FLOAT), dimension(*), intent(inout) :: ii
real(C_FLOAT), dimension(*), intent(out) :: ro
real(C_FLOAT), dimension(*), intent(out) :: io
end subroutine fftwf_execute_split_dft
type(C_PTR) function fftwf_plan_many_dft_r2c(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftwf_plan_many_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(C_FLOAT), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftwf_plan_many_dft_r2c
type(C_PTR) function fftwf_plan_dft_r2c(rank,n,in,out,flags) bind(C, name='fftwf_plan_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(C_FLOAT), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_r2c
type(C_PTR) function fftwf_plan_dft_r2c_1d(n,in,out,flags) bind(C, name='fftwf_plan_dft_r2c_1d')
import
integer(C_INT), value :: n
real(C_FLOAT), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_r2c_1d
type(C_PTR) function fftwf_plan_dft_r2c_2d(n0,n1,in,out,flags) bind(C, name='fftwf_plan_dft_r2c_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(C_FLOAT), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_r2c_2d
type(C_PTR) function fftwf_plan_dft_r2c_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwf_plan_dft_r2c_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(C_FLOAT), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_r2c_3d
type(C_PTR) function fftwf_plan_many_dft_c2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftwf_plan_many_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftwf_plan_many_dft_c2r
type(C_PTR) function fftwf_plan_dft_c2r(rank,n,in,out,flags) bind(C, name='fftwf_plan_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_c2r
type(C_PTR) function fftwf_plan_dft_c2r_1d(n,in,out,flags) bind(C, name='fftwf_plan_dft_c2r_1d')
import
integer(C_INT), value :: n
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_c2r_1d
type(C_PTR) function fftwf_plan_dft_c2r_2d(n0,n1,in,out,flags) bind(C, name='fftwf_plan_dft_c2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_c2r_2d
type(C_PTR) function fftwf_plan_dft_c2r_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwf_plan_dft_c2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_dft_c2r_3d
type(C_PTR) function fftwf_plan_guru_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwf_plan_guru_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_guru_dft_r2c
type(C_PTR) function fftwf_plan_guru_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwf_plan_guru_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_guru_dft_c2r
type(C_PTR) function fftwf_plan_guru_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftwf_plan_guru_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: ro
real(C_FLOAT), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwf_plan_guru_split_dft_r2c
type(C_PTR) function fftwf_plan_guru_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftwf_plan_guru_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: ri
real(C_FLOAT), dimension(*), intent(out) :: ii
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_guru_split_dft_c2r
type(C_PTR) function fftwf_plan_guru64_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwf_plan_guru64_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_guru64_dft_r2c
type(C_PTR) function fftwf_plan_guru64_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwf_plan_guru64_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_guru64_dft_c2r
type(C_PTR) function fftwf_plan_guru64_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftwf_plan_guru64_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: ro
real(C_FLOAT), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwf_plan_guru64_split_dft_r2c
type(C_PTR) function fftwf_plan_guru64_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftwf_plan_guru64_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: ri
real(C_FLOAT), dimension(*), intent(out) :: ii
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwf_plan_guru64_split_dft_c2r
subroutine fftwf_execute_dft_r2c(p,in,out) bind(C, name='fftwf_execute_dft_r2c')
import
type(C_PTR), value :: p
real(C_FLOAT), dimension(*), intent(inout) :: in
complex(C_FLOAT_COMPLEX), dimension(*), intent(out) :: out
end subroutine fftwf_execute_dft_r2c
subroutine fftwf_execute_dft_c2r(p,in,out) bind(C, name='fftwf_execute_dft_c2r')
import
type(C_PTR), value :: p
complex(C_FLOAT_COMPLEX), dimension(*), intent(inout) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
end subroutine fftwf_execute_dft_c2r
subroutine fftwf_execute_split_dft_r2c(p,in,ro,io) bind(C, name='fftwf_execute_split_dft_r2c')
import
type(C_PTR), value :: p
real(C_FLOAT), dimension(*), intent(inout) :: in
real(C_FLOAT), dimension(*), intent(out) :: ro
real(C_FLOAT), dimension(*), intent(out) :: io
end subroutine fftwf_execute_split_dft_r2c
subroutine fftwf_execute_split_dft_c2r(p,ri,ii,out) bind(C, name='fftwf_execute_split_dft_c2r')
import
type(C_PTR), value :: p
real(C_FLOAT), dimension(*), intent(inout) :: ri
real(C_FLOAT), dimension(*), intent(inout) :: ii
real(C_FLOAT), dimension(*), intent(out) :: out
end subroutine fftwf_execute_split_dft_c2r
type(C_PTR) function fftwf_plan_many_r2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,kind,flags) &
bind(C, name='fftwf_plan_many_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(C_FLOAT), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwf_plan_many_r2r
type(C_PTR) function fftwf_plan_r2r(rank,n,in,out,kind,flags) bind(C, name='fftwf_plan_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwf_plan_r2r
type(C_PTR) function fftwf_plan_r2r_1d(n,in,out,kind,flags) bind(C, name='fftwf_plan_r2r_1d')
import
integer(C_INT), value :: n
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind
integer(C_INT), value :: flags
end function fftwf_plan_r2r_1d
type(C_PTR) function fftwf_plan_r2r_2d(n0,n1,in,out,kind0,kind1,flags) bind(C, name='fftwf_plan_r2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_INT), value :: flags
end function fftwf_plan_r2r_2d
type(C_PTR) function fftwf_plan_r2r_3d(n0,n1,n2,in,out,kind0,kind1,kind2,flags) bind(C, name='fftwf_plan_r2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_FFTW_R2R_KIND), value :: kind2
integer(C_INT), value :: flags
end function fftwf_plan_r2r_3d
type(C_PTR) function fftwf_plan_guru_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftwf_plan_guru_r2r')
import
integer(C_INT), value :: rank
type(fftwf_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwf_plan_guru_r2r
type(C_PTR) function fftwf_plan_guru64_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftwf_plan_guru64_r2r')
import
integer(C_INT), value :: rank
type(fftwf_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwf_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_FLOAT), dimension(*), intent(out) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwf_plan_guru64_r2r
subroutine fftwf_execute_r2r(p,in,out) bind(C, name='fftwf_execute_r2r')
import
type(C_PTR), value :: p
real(C_FLOAT), dimension(*), intent(inout) :: in
real(C_FLOAT), dimension(*), intent(out) :: out
end subroutine fftwf_execute_r2r
subroutine fftwf_destroy_plan(p) bind(C, name='fftwf_destroy_plan')
import
type(C_PTR), value :: p
end subroutine fftwf_destroy_plan
subroutine fftwf_forget_wisdom() bind(C, name='fftwf_forget_wisdom')
import
end subroutine fftwf_forget_wisdom
subroutine fftwf_cleanup() bind(C, name='fftwf_cleanup')
import
end subroutine fftwf_cleanup
subroutine fftwf_set_timelimit(t) bind(C, name='fftwf_set_timelimit')
import
real(C_DOUBLE), value :: t
end subroutine fftwf_set_timelimit
subroutine fftwf_plan_with_nthreads(nthreads) bind(C, name='fftwf_plan_with_nthreads')
import
integer(C_INT), value :: nthreads
end subroutine fftwf_plan_with_nthreads
integer(C_INT) function fftwf_planner_nthreads() bind(C, name='fftwf_planner_nthreads')
import
end function fftwf_planner_nthreads
integer(C_INT) function fftwf_init_threads() bind(C, name='fftwf_init_threads')
import
end function fftwf_init_threads
subroutine fftwf_cleanup_threads() bind(C, name='fftwf_cleanup_threads')
import
end subroutine fftwf_cleanup_threads
! Unable to generate Fortran interface for fftwf_threads_set_callback
subroutine fftwf_make_planner_thread_safe() bind(C, name='fftwf_make_planner_thread_safe')
import
end subroutine fftwf_make_planner_thread_safe
integer(C_INT) function fftwf_export_wisdom_to_filename(filename) bind(C, name='fftwf_export_wisdom_to_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftwf_export_wisdom_to_filename
subroutine fftwf_export_wisdom_to_file(output_file) bind(C, name='fftwf_export_wisdom_to_file')
import
type(C_PTR), value :: output_file
end subroutine fftwf_export_wisdom_to_file
type(C_PTR) function fftwf_export_wisdom_to_string() bind(C, name='fftwf_export_wisdom_to_string')
import
end function fftwf_export_wisdom_to_string
subroutine fftwf_export_wisdom(write_char,data) bind(C, name='fftwf_export_wisdom')
import
type(C_FUNPTR), value :: write_char
type(C_PTR), value :: data
end subroutine fftwf_export_wisdom
integer(C_INT) function fftwf_import_system_wisdom() bind(C, name='fftwf_import_system_wisdom')
import
end function fftwf_import_system_wisdom
integer(C_INT) function fftwf_import_wisdom_from_filename(filename) bind(C, name='fftwf_import_wisdom_from_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftwf_import_wisdom_from_filename
integer(C_INT) function fftwf_import_wisdom_from_file(input_file) bind(C, name='fftwf_import_wisdom_from_file')
import
type(C_PTR), value :: input_file
end function fftwf_import_wisdom_from_file
integer(C_INT) function fftwf_import_wisdom_from_string(input_string) bind(C, name='fftwf_import_wisdom_from_string')
import
character(C_CHAR), dimension(*), intent(in) :: input_string
end function fftwf_import_wisdom_from_string
integer(C_INT) function fftwf_import_wisdom(read_char,data) bind(C, name='fftwf_import_wisdom')
import
type(C_FUNPTR), value :: read_char
type(C_PTR), value :: data
end function fftwf_import_wisdom
subroutine fftwf_fprint_plan(p,output_file) bind(C, name='fftwf_fprint_plan')
import
type(C_PTR), value :: p
type(C_PTR), value :: output_file
end subroutine fftwf_fprint_plan
subroutine fftwf_print_plan(p) bind(C, name='fftwf_print_plan')
import
type(C_PTR), value :: p
end subroutine fftwf_print_plan
type(C_PTR) function fftwf_sprint_plan(p) bind(C, name='fftwf_sprint_plan')
import
type(C_PTR), value :: p
end function fftwf_sprint_plan
type(C_PTR) function fftwf_malloc(n) bind(C, name='fftwf_malloc')
import
integer(C_SIZE_T), value :: n
end function fftwf_malloc
type(C_PTR) function fftwf_alloc_real(n) bind(C, name='fftwf_alloc_real')
import
integer(C_SIZE_T), value :: n
end function fftwf_alloc_real
type(C_PTR) function fftwf_alloc_complex(n) bind(C, name='fftwf_alloc_complex')
import
integer(C_SIZE_T), value :: n
end function fftwf_alloc_complex
subroutine fftwf_free(p) bind(C, name='fftwf_free')
import
type(C_PTR), value :: p
end subroutine fftwf_free
subroutine fftwf_flops(p,add,mul,fmas) bind(C, name='fftwf_flops')
import
type(C_PTR), value :: p
real(C_DOUBLE), intent(out) :: add
real(C_DOUBLE), intent(out) :: mul
real(C_DOUBLE), intent(out) :: fmas
end subroutine fftwf_flops
real(C_DOUBLE) function fftwf_estimate_cost(p) bind(C, name='fftwf_estimate_cost')
import
type(C_PTR), value :: p
end function fftwf_estimate_cost
real(C_DOUBLE) function fftwf_cost(p) bind(C, name='fftwf_cost')
import
type(C_PTR), value :: p
end function fftwf_cost
integer(C_INT) function fftwf_alignment_of(p) bind(C, name='fftwf_alignment_of')
import
real(C_FLOAT), dimension(*), intent(out) :: p
end function fftwf_alignment_of
end interface
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* The following statement of license applies *only* to this header file,
* and *not* to the other files distributed with FFTW or derived therefrom:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/***************************** NOTE TO USERS *********************************
*
* THIS IS A HEADER FILE, NOT A MANUAL
*
* If you want to know how to use FFTW, please read the manual,
* online at http://www.fftw.org/doc/ and also included with FFTW.
* For a quick start, see the manual's tutorial section.
*
* (Reading header files to learn how to use a library is a habit
* stemming from code lacking a proper manual. Arguably, it's a
* *bad* habit in most cases, because header files can contain
* interfaces that are not part of the public, stable API.)
*
****************************************************************************/
#ifndef FFTW3_H
#define FFTW3_H
#include <stdio.h>
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/* If <complex.h> is included, use the C99 complex type. Otherwise
define a type bit-compatible with C99 complex */
#if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I)
# define FFTW_DEFINE_COMPLEX(R, C) typedef R _Complex C
#else
# define FFTW_DEFINE_COMPLEX(R, C) typedef R C[2]
#endif
#define FFTW_CONCAT(prefix, name) prefix ## name
#define FFTW_MANGLE_DOUBLE(name) FFTW_CONCAT(fftw_, name)
#define FFTW_MANGLE_FLOAT(name) FFTW_CONCAT(fftwf_, name)
#define FFTW_MANGLE_LONG_DOUBLE(name) FFTW_CONCAT(fftwl_, name)
#define FFTW_MANGLE_QUAD(name) FFTW_CONCAT(fftwq_, name)
/* IMPORTANT: for Windows compilers, you should add a line
#define FFTW_DLL
here and in kernel/ifftw.h if you are compiling/using FFTW as a
DLL, in order to do the proper importing/exporting, or
alternatively compile with -DFFTW_DLL or the equivalent
command-line flag. This is not necessary under MinGW/Cygwin, where
libtool does the imports/exports automatically. */
#if defined(FFTW_DLL) && (defined(_WIN32) || defined(__WIN32__))
/* annoying Windows syntax for shared-library declarations */
# if defined(COMPILING_FFTW) /* defined in api.h when compiling FFTW */
# define FFTW_EXTERN extern __declspec(dllexport)
# else /* user is calling FFTW; import symbol */
# define FFTW_EXTERN extern __declspec(dllimport)
# endif
#else
# define FFTW_EXTERN extern
#endif
/* specify calling convention (Windows only) */
#if defined(_WIN32) || defined(__WIN32__)
# define FFTW_CDECL __cdecl
#else
# define FFTW_CDECL
#endif
enum fftw_r2r_kind_do_not_use_me {
FFTW_R2HC=0, FFTW_HC2R=1, FFTW_DHT=2,
FFTW_REDFT00=3, FFTW_REDFT01=4, FFTW_REDFT10=5, FFTW_REDFT11=6,
FFTW_RODFT00=7, FFTW_RODFT01=8, FFTW_RODFT10=9, FFTW_RODFT11=10
};
struct fftw_iodim_do_not_use_me {
int n; /* dimension size */
int is; /* input stride */
int os; /* output stride */
};
#include <stddef.h> /* for ptrdiff_t */
struct fftw_iodim64_do_not_use_me {
ptrdiff_t n; /* dimension size */
ptrdiff_t is; /* input stride */
ptrdiff_t os; /* output stride */
};
typedef void (FFTW_CDECL *fftw_write_char_func_do_not_use_me)(char c, void *);
typedef int (FFTW_CDECL *fftw_read_char_func_do_not_use_me)(void *);
/*
huge second-order macro that defines prototypes for all API
functions. We expand this macro for each supported precision
X: name-mangling macro
R: real data type
C: complex data type
*/
#define FFTW_DEFINE_API(X, R, C) \
\
FFTW_DEFINE_COMPLEX(R, C); \
\
typedef struct X(plan_s) *X(plan); \
\
typedef struct fftw_iodim_do_not_use_me X(iodim); \
typedef struct fftw_iodim64_do_not_use_me X(iodim64); \
\
typedef enum fftw_r2r_kind_do_not_use_me X(r2r_kind); \
\
typedef fftw_write_char_func_do_not_use_me X(write_char_func); \
typedef fftw_read_char_func_do_not_use_me X(read_char_func); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute)(const X(plan) p); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft)(int rank, const int *n, \
C *in, C *out, int sign, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_1d)(int n, C *in, C *out, int sign, \
unsigned flags); \
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_2d)(int n0, int n1, \
C *in, C *out, int sign, unsigned flags); \
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_3d)(int n0, int n1, int n2, \
C *in, C *out, int sign, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_many_dft)(int rank, const int *n, \
int howmany, \
C *in, const int *inembed, \
int istride, int idist, \
C *out, const int *onembed, \
int ostride, int odist, \
int sign, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_dft)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
C *in, C *out, \
int sign, unsigned flags); \
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_split_dft)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
R *ri, R *ii, R *ro, R *io, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_dft)(int rank, \
const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
C *in, C *out, \
int sign, unsigned flags); \
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_split_dft)(int rank, \
const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
R *ri, R *ii, R *ro, R *io, \
unsigned flags); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_dft)(const X(plan) p, C *in, C *out); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_split_dft)(const X(plan) p, R *ri, R *ii, \
R *ro, R *io); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_many_dft_r2c)(int rank, const int *n, \
int howmany, \
R *in, const int *inembed, \
int istride, int idist, \
C *out, const int *onembed, \
int ostride, int odist, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_r2c)(int rank, const int *n, \
R *in, C *out, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_r2c_1d)(int n,R *in,C *out,unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_r2c_2d)(int n0, int n1, \
R *in, C *out, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_r2c_3d)(int n0, int n1, \
int n2, \
R *in, C *out, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_many_dft_c2r)(int rank, const int *n, \
int howmany, \
C *in, const int *inembed, \
int istride, int idist, \
R *out, const int *onembed, \
int ostride, int odist, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_c2r)(int rank, const int *n, \
C *in, R *out, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_c2r_1d)(int n,C *in,R *out,unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_c2r_2d)(int n0, int n1, \
C *in, R *out, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_dft_c2r_3d)(int n0, int n1, \
int n2, \
C *in, R *out, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_dft_r2c)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
R *in, C *out, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_dft_c2r)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
C *in, R *out, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_split_dft_r2c)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
R *in, R *ro, R *io, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_split_dft_c2r)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
R *ri, R *ii, R *out, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_dft_r2c)(int rank, \
const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
R *in, C *out, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_dft_c2r)(int rank, \
const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
C *in, R *out, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_split_dft_r2c)(int rank, const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
R *in, R *ro, R *io, \
unsigned flags); \
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_split_dft_c2r)(int rank, const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
R *ri, R *ii, R *out, \
unsigned flags); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_dft_r2c)(const X(plan) p, R *in, C *out); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_dft_c2r)(const X(plan) p, C *in, R *out); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_split_dft_r2c)(const X(plan) p, \
R *in, R *ro, R *io); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_split_dft_c2r)(const X(plan) p, \
R *ri, R *ii, R *out); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_many_r2r)(int rank, const int *n, \
int howmany, \
R *in, const int *inembed, \
int istride, int idist, \
R *out, const int *onembed, \
int ostride, int odist, \
const X(r2r_kind) *kind, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_r2r)(int rank, const int *n, R *in, R *out, \
const X(r2r_kind) *kind, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_r2r_1d)(int n, R *in, R *out, \
X(r2r_kind) kind, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_r2r_2d)(int n0, int n1, R *in, R *out, \
X(r2r_kind) kind0, X(r2r_kind) kind1, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_r2r_3d)(int n0, int n1, int n2, \
R *in, R *out, X(r2r_kind) kind0, \
X(r2r_kind) kind1, X(r2r_kind) kind2, \
unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru_r2r)(int rank, const X(iodim) *dims, \
int howmany_rank, \
const X(iodim) *howmany_dims, \
R *in, R *out, \
const X(r2r_kind) *kind, unsigned flags); \
\
FFTW_EXTERN X(plan) \
FFTW_CDECL X(plan_guru64_r2r)(int rank, const X(iodim64) *dims, \
int howmany_rank, \
const X(iodim64) *howmany_dims, \
R *in, R *out, \
const X(r2r_kind) *kind, unsigned flags); \
\
FFTW_EXTERN void \
FFTW_CDECL X(execute_r2r)(const X(plan) p, R *in, R *out); \
\
FFTW_EXTERN void \
FFTW_CDECL X(destroy_plan)(X(plan) p); \
\
FFTW_EXTERN void \
FFTW_CDECL X(forget_wisdom)(void); \
FFTW_EXTERN void \
FFTW_CDECL X(cleanup)(void); \
\
FFTW_EXTERN void \
FFTW_CDECL X(set_timelimit)(double t); \
\
FFTW_EXTERN void \
FFTW_CDECL X(plan_with_nthreads)(int nthreads); \
\
FFTW_EXTERN int \
FFTW_CDECL X(planner_nthreads)(void); \
\
FFTW_EXTERN int \
FFTW_CDECL X(init_threads)(void); \
\
FFTW_EXTERN void \
FFTW_CDECL X(cleanup_threads)(void); \
\
FFTW_EXTERN void \
FFTW_CDECL X(threads_set_callback)( \
void (*parallel_loop)(void *(*work)(char *), \
char *jobdata, size_t elsize, int njobs, void *data), void *data); \
\
FFTW_EXTERN void \
FFTW_CDECL X(make_planner_thread_safe)(void); \
\
FFTW_EXTERN int \
FFTW_CDECL X(export_wisdom_to_filename)(const char *filename); \
\
FFTW_EXTERN void \
FFTW_CDECL X(export_wisdom_to_file)(FILE *output_file); \
\
FFTW_EXTERN char * \
FFTW_CDECL X(export_wisdom_to_string)(void); \
\
FFTW_EXTERN void \
FFTW_CDECL X(export_wisdom)(X(write_char_func) write_char, \
void *data); \
FFTW_EXTERN int \
FFTW_CDECL X(import_system_wisdom)(void); \
\
FFTW_EXTERN int \
FFTW_CDECL X(import_wisdom_from_filename)(const char *filename); \
\
FFTW_EXTERN int \
FFTW_CDECL X(import_wisdom_from_file)(FILE *input_file); \
\
FFTW_EXTERN int \
FFTW_CDECL X(import_wisdom_from_string)(const char *input_string); \
\
FFTW_EXTERN int \
FFTW_CDECL X(import_wisdom)(X(read_char_func) read_char, void *data); \
\
FFTW_EXTERN void \
FFTW_CDECL X(fprint_plan)(const X(plan) p, FILE *output_file); \
\
FFTW_EXTERN void \
FFTW_CDECL X(print_plan)(const X(plan) p); \
\
FFTW_EXTERN char * \
FFTW_CDECL X(sprint_plan)(const X(plan) p); \
\
FFTW_EXTERN void * \
FFTW_CDECL X(malloc)(size_t n); \
\
FFTW_EXTERN R * \
FFTW_CDECL X(alloc_real)(size_t n); \
FFTW_EXTERN C * \
FFTW_CDECL X(alloc_complex)(size_t n); \
\
FFTW_EXTERN void \
FFTW_CDECL X(free)(void *p); \
\
FFTW_EXTERN void \
FFTW_CDECL X(flops)(const X(plan) p, \
double *add, double *mul, double *fmas); \
FFTW_EXTERN double \
FFTW_CDECL X(estimate_cost)(const X(plan) p); \
\
FFTW_EXTERN double \
FFTW_CDECL X(cost)(const X(plan) p); \
\
FFTW_EXTERN int \
FFTW_CDECL X(alignment_of)(R *p); \
\
FFTW_EXTERN const char X(version)[]; \
FFTW_EXTERN const char X(cc)[]; \
FFTW_EXTERN const char X(codelet_optim)[];
/* end of FFTW_DEFINE_API macro */
FFTW_DEFINE_API(FFTW_MANGLE_DOUBLE, double, fftw_complex)
FFTW_DEFINE_API(FFTW_MANGLE_FLOAT, float, fftwf_complex)
FFTW_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE, long double, fftwl_complex)
/* __float128 (quad precision) is a gcc extension on i386, x86_64, and ia64
for gcc >= 4.6 (compiled in FFTW with --enable-quad-precision) */
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) \
&& !(defined(__ICC) || defined(__INTEL_COMPILER) || defined(__CUDACC__) || defined(__PGI)) \
&& (defined(__i386__) || defined(__x86_64__) || defined(__ia64__))
# if !defined(FFTW_NO_Complex) && defined(_Complex_I) && defined(complex) && defined(I)
/* note: __float128 is a typedef, which is not supported with the _Complex
keyword in gcc, so instead we use this ugly __attribute__ version.
However, we can't simply pass the __attribute__ version to
FFTW_DEFINE_API because the __attribute__ confuses gcc in pointer
types. Hence redefining FFTW_DEFINE_COMPLEX. Ugh. */
# undef FFTW_DEFINE_COMPLEX
# define FFTW_DEFINE_COMPLEX(R, C) typedef _Complex float __attribute__((mode(TC))) C
# endif
FFTW_DEFINE_API(FFTW_MANGLE_QUAD, __float128, fftwq_complex)
#endif
#define FFTW_FORWARD (-1)
#define FFTW_BACKWARD (+1)
#define FFTW_NO_TIMELIMIT (-1.0)
/* documented flags */
#define FFTW_MEASURE (0U)
#define FFTW_DESTROY_INPUT (1U << 0)
#define FFTW_UNALIGNED (1U << 1)
#define FFTW_CONSERVE_MEMORY (1U << 2)
#define FFTW_EXHAUSTIVE (1U << 3) /* NO_EXHAUSTIVE is default */
#define FFTW_PRESERVE_INPUT (1U << 4) /* cancels FFTW_DESTROY_INPUT */
#define FFTW_PATIENT (1U << 5) /* IMPATIENT is default */
#define FFTW_ESTIMATE (1U << 6)
#define FFTW_WISDOM_ONLY (1U << 21)
/* undocumented beyond-guru flags */
#define FFTW_ESTIMATE_PATIENT (1U << 7)
#define FFTW_BELIEVE_PCOST (1U << 8)
#define FFTW_NO_DFT_R2HC (1U << 9)
#define FFTW_NO_NONTHREADED (1U << 10)
#define FFTW_NO_BUFFERING (1U << 11)
#define FFTW_NO_INDIRECT_OP (1U << 12)
#define FFTW_ALLOW_LARGE_GENERIC (1U << 13) /* NO_LARGE_GENERIC is default */
#define FFTW_NO_RANK_SPLITS (1U << 14)
#define FFTW_NO_VRANK_SPLITS (1U << 15)
#define FFTW_NO_VRECURSE (1U << 16)
#define FFTW_NO_SIMD (1U << 17)
#define FFTW_NO_SLOW (1U << 18)
#define FFTW_NO_FIXED_RADIX_LARGE_N (1U << 19)
#define FFTW_ALLOW_PRUNING (1U << 20)
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */
#endif /* FFTW3_H */
! Generated automatically. DO NOT EDIT!
type, bind(C) :: fftwl_iodim
integer(C_INT) n, is, os
end type fftwl_iodim
type, bind(C) :: fftwl_iodim64
integer(C_INTPTR_T) n, is, os
end type fftwl_iodim64
interface
type(C_PTR) function fftwl_plan_dft(rank,n,in,out,sign,flags) bind(C, name='fftwl_plan_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_dft
type(C_PTR) function fftwl_plan_dft_1d(n,in,out,sign,flags) bind(C, name='fftwl_plan_dft_1d')
import
integer(C_INT), value :: n
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_dft_1d
type(C_PTR) function fftwl_plan_dft_2d(n0,n1,in,out,sign,flags) bind(C, name='fftwl_plan_dft_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_dft_2d
type(C_PTR) function fftwl_plan_dft_3d(n0,n1,n2,in,out,sign,flags) bind(C, name='fftwl_plan_dft_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_dft_3d
type(C_PTR) function fftwl_plan_many_dft(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,sign,flags) &
bind(C, name='fftwl_plan_many_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_many_dft
type(C_PTR) function fftwl_plan_guru_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftwl_plan_guru_dft')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_guru_dft
type(C_PTR) function fftwl_plan_guru_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftwl_plan_guru_split_dft')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ri
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ii
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ro
real(C_LONG_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwl_plan_guru_split_dft
type(C_PTR) function fftwl_plan_guru64_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftwl_plan_guru64_dft')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwl_plan_guru64_dft
type(C_PTR) function fftwl_plan_guru64_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftwl_plan_guru64_split_dft')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ri
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ii
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ro
real(C_LONG_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwl_plan_guru64_split_dft
subroutine fftwl_execute_dft(p,in,out) bind(C, name='fftwl_execute_dft')
import
type(C_PTR), value :: p
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(inout) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
end subroutine fftwl_execute_dft
subroutine fftwl_execute_split_dft(p,ri,ii,ro,io) bind(C, name='fftwl_execute_split_dft')
import
type(C_PTR), value :: p
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: ri
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: ii
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ro
real(C_LONG_DOUBLE), dimension(*), intent(out) :: io
end subroutine fftwl_execute_split_dft
type(C_PTR) function fftwl_plan_many_dft_r2c(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftwl_plan_many_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftwl_plan_many_dft_r2c
type(C_PTR) function fftwl_plan_dft_r2c(rank,n,in,out,flags) bind(C, name='fftwl_plan_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_r2c
type(C_PTR) function fftwl_plan_dft_r2c_1d(n,in,out,flags) bind(C, name='fftwl_plan_dft_r2c_1d')
import
integer(C_INT), value :: n
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_r2c_1d
type(C_PTR) function fftwl_plan_dft_r2c_2d(n0,n1,in,out,flags) bind(C, name='fftwl_plan_dft_r2c_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_r2c_2d
type(C_PTR) function fftwl_plan_dft_r2c_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwl_plan_dft_r2c_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_r2c_3d
type(C_PTR) function fftwl_plan_many_dft_c2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftwl_plan_many_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftwl_plan_many_dft_c2r
type(C_PTR) function fftwl_plan_dft_c2r(rank,n,in,out,flags) bind(C, name='fftwl_plan_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_c2r
type(C_PTR) function fftwl_plan_dft_c2r_1d(n,in,out,flags) bind(C, name='fftwl_plan_dft_c2r_1d')
import
integer(C_INT), value :: n
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_c2r_1d
type(C_PTR) function fftwl_plan_dft_c2r_2d(n0,n1,in,out,flags) bind(C, name='fftwl_plan_dft_c2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_c2r_2d
type(C_PTR) function fftwl_plan_dft_c2r_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwl_plan_dft_c2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_dft_c2r_3d
type(C_PTR) function fftwl_plan_guru_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwl_plan_guru_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_guru_dft_r2c
type(C_PTR) function fftwl_plan_guru_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwl_plan_guru_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_guru_dft_c2r
type(C_PTR) function fftwl_plan_guru_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftwl_plan_guru_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ro
real(C_LONG_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwl_plan_guru_split_dft_r2c
type(C_PTR) function fftwl_plan_guru_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftwl_plan_guru_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ri
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ii
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_guru_split_dft_c2r
type(C_PTR) function fftwl_plan_guru64_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwl_plan_guru64_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_guru64_dft_r2c
type(C_PTR) function fftwl_plan_guru64_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwl_plan_guru64_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_guru64_dft_c2r
type(C_PTR) function fftwl_plan_guru64_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftwl_plan_guru64_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ro
real(C_LONG_DOUBLE), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwl_plan_guru64_split_dft_r2c
type(C_PTR) function fftwl_plan_guru64_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftwl_plan_guru64_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ri
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ii
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwl_plan_guru64_split_dft_c2r
subroutine fftwl_execute_dft_r2c(p,in,out) bind(C, name='fftwl_execute_dft_r2c')
import
type(C_PTR), value :: p
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: in
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out) :: out
end subroutine fftwl_execute_dft_r2c
subroutine fftwl_execute_dft_c2r(p,in,out) bind(C, name='fftwl_execute_dft_c2r')
import
type(C_PTR), value :: p
complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(inout) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
end subroutine fftwl_execute_dft_c2r
subroutine fftwl_execute_split_dft_r2c(p,in,ro,io) bind(C, name='fftwl_execute_split_dft_r2c')
import
type(C_PTR), value :: p
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: ro
real(C_LONG_DOUBLE), dimension(*), intent(out) :: io
end subroutine fftwl_execute_split_dft_r2c
subroutine fftwl_execute_split_dft_c2r(p,ri,ii,out) bind(C, name='fftwl_execute_split_dft_c2r')
import
type(C_PTR), value :: p
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: ri
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: ii
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
end subroutine fftwl_execute_split_dft_c2r
type(C_PTR) function fftwl_plan_many_r2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,kind,flags) &
bind(C, name='fftwl_plan_many_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwl_plan_many_r2r
type(C_PTR) function fftwl_plan_r2r(rank,n,in,out,kind,flags) bind(C, name='fftwl_plan_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwl_plan_r2r
type(C_PTR) function fftwl_plan_r2r_1d(n,in,out,kind,flags) bind(C, name='fftwl_plan_r2r_1d')
import
integer(C_INT), value :: n
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind
integer(C_INT), value :: flags
end function fftwl_plan_r2r_1d
type(C_PTR) function fftwl_plan_r2r_2d(n0,n1,in,out,kind0,kind1,flags) bind(C, name='fftwl_plan_r2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_INT), value :: flags
end function fftwl_plan_r2r_2d
type(C_PTR) function fftwl_plan_r2r_3d(n0,n1,n2,in,out,kind0,kind1,kind2,flags) bind(C, name='fftwl_plan_r2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_FFTW_R2R_KIND), value :: kind2
integer(C_INT), value :: flags
end function fftwl_plan_r2r_3d
type(C_PTR) function fftwl_plan_guru_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftwl_plan_guru_r2r')
import
integer(C_INT), value :: rank
type(fftwl_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwl_plan_guru_r2r
type(C_PTR) function fftwl_plan_guru64_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftwl_plan_guru64_r2r')
import
integer(C_INT), value :: rank
type(fftwl_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwl_iodim64), dimension(*), intent(in) :: howmany_dims
real(C_LONG_DOUBLE), dimension(*), intent(out) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwl_plan_guru64_r2r
subroutine fftwl_execute_r2r(p,in,out) bind(C, name='fftwl_execute_r2r')
import
type(C_PTR), value :: p
real(C_LONG_DOUBLE), dimension(*), intent(inout) :: in
real(C_LONG_DOUBLE), dimension(*), intent(out) :: out
end subroutine fftwl_execute_r2r
subroutine fftwl_destroy_plan(p) bind(C, name='fftwl_destroy_plan')
import
type(C_PTR), value :: p
end subroutine fftwl_destroy_plan
subroutine fftwl_forget_wisdom() bind(C, name='fftwl_forget_wisdom')
import
end subroutine fftwl_forget_wisdom
subroutine fftwl_cleanup() bind(C, name='fftwl_cleanup')
import
end subroutine fftwl_cleanup
subroutine fftwl_set_timelimit(t) bind(C, name='fftwl_set_timelimit')
import
real(C_DOUBLE), value :: t
end subroutine fftwl_set_timelimit
subroutine fftwl_plan_with_nthreads(nthreads) bind(C, name='fftwl_plan_with_nthreads')
import
integer(C_INT), value :: nthreads
end subroutine fftwl_plan_with_nthreads
integer(C_INT) function fftwl_planner_nthreads() bind(C, name='fftwl_planner_nthreads')
import
end function fftwl_planner_nthreads
integer(C_INT) function fftwl_init_threads() bind(C, name='fftwl_init_threads')
import
end function fftwl_init_threads
subroutine fftwl_cleanup_threads() bind(C, name='fftwl_cleanup_threads')
import
end subroutine fftwl_cleanup_threads
! Unable to generate Fortran interface for fftwl_threads_set_callback
subroutine fftwl_make_planner_thread_safe() bind(C, name='fftwl_make_planner_thread_safe')
import
end subroutine fftwl_make_planner_thread_safe
integer(C_INT) function fftwl_export_wisdom_to_filename(filename) bind(C, name='fftwl_export_wisdom_to_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftwl_export_wisdom_to_filename
subroutine fftwl_export_wisdom_to_file(output_file) bind(C, name='fftwl_export_wisdom_to_file')
import
type(C_PTR), value :: output_file
end subroutine fftwl_export_wisdom_to_file
type(C_PTR) function fftwl_export_wisdom_to_string() bind(C, name='fftwl_export_wisdom_to_string')
import
end function fftwl_export_wisdom_to_string
subroutine fftwl_export_wisdom(write_char,data) bind(C, name='fftwl_export_wisdom')
import
type(C_FUNPTR), value :: write_char
type(C_PTR), value :: data
end subroutine fftwl_export_wisdom
integer(C_INT) function fftwl_import_system_wisdom() bind(C, name='fftwl_import_system_wisdom')
import
end function fftwl_import_system_wisdom
integer(C_INT) function fftwl_import_wisdom_from_filename(filename) bind(C, name='fftwl_import_wisdom_from_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftwl_import_wisdom_from_filename
integer(C_INT) function fftwl_import_wisdom_from_file(input_file) bind(C, name='fftwl_import_wisdom_from_file')
import
type(C_PTR), value :: input_file
end function fftwl_import_wisdom_from_file
integer(C_INT) function fftwl_import_wisdom_from_string(input_string) bind(C, name='fftwl_import_wisdom_from_string')
import
character(C_CHAR), dimension(*), intent(in) :: input_string
end function fftwl_import_wisdom_from_string
integer(C_INT) function fftwl_import_wisdom(read_char,data) bind(C, name='fftwl_import_wisdom')
import
type(C_FUNPTR), value :: read_char
type(C_PTR), value :: data
end function fftwl_import_wisdom
subroutine fftwl_fprint_plan(p,output_file) bind(C, name='fftwl_fprint_plan')
import
type(C_PTR), value :: p
type(C_PTR), value :: output_file
end subroutine fftwl_fprint_plan
subroutine fftwl_print_plan(p) bind(C, name='fftwl_print_plan')
import
type(C_PTR), value :: p
end subroutine fftwl_print_plan
type(C_PTR) function fftwl_sprint_plan(p) bind(C, name='fftwl_sprint_plan')
import
type(C_PTR), value :: p
end function fftwl_sprint_plan
type(C_PTR) function fftwl_malloc(n) bind(C, name='fftwl_malloc')
import
integer(C_SIZE_T), value :: n
end function fftwl_malloc
type(C_PTR) function fftwl_alloc_real(n) bind(C, name='fftwl_alloc_real')
import
integer(C_SIZE_T), value :: n
end function fftwl_alloc_real
type(C_PTR) function fftwl_alloc_complex(n) bind(C, name='fftwl_alloc_complex')
import
integer(C_SIZE_T), value :: n
end function fftwl_alloc_complex
subroutine fftwl_free(p) bind(C, name='fftwl_free')
import
type(C_PTR), value :: p
end subroutine fftwl_free
subroutine fftwl_flops(p,add,mul,fmas) bind(C, name='fftwl_flops')
import
type(C_PTR), value :: p
real(C_DOUBLE), intent(out) :: add
real(C_DOUBLE), intent(out) :: mul
real(C_DOUBLE), intent(out) :: fmas
end subroutine fftwl_flops
real(C_DOUBLE) function fftwl_estimate_cost(p) bind(C, name='fftwl_estimate_cost')
import
type(C_PTR), value :: p
end function fftwl_estimate_cost
real(C_DOUBLE) function fftwl_cost(p) bind(C, name='fftwl_cost')
import
type(C_PTR), value :: p
end function fftwl_cost
integer(C_INT) function fftwl_alignment_of(p) bind(C, name='fftwl_alignment_of')
import
real(C_LONG_DOUBLE), dimension(*), intent(out) :: p
end function fftwl_alignment_of
end interface
! Generated automatically. DO NOT EDIT!
type, bind(C) :: fftwq_iodim
integer(C_INT) n, is, os
end type fftwq_iodim
type, bind(C) :: fftwq_iodim64
integer(C_INTPTR_T) n, is, os
end type fftwq_iodim64
interface
type(C_PTR) function fftwq_plan_dft(rank,n,in,out,sign,flags) bind(C, name='fftwq_plan_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_dft
type(C_PTR) function fftwq_plan_dft_1d(n,in,out,sign,flags) bind(C, name='fftwq_plan_dft_1d')
import
integer(C_INT), value :: n
complex(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_dft_1d
type(C_PTR) function fftwq_plan_dft_2d(n0,n1,in,out,sign,flags) bind(C, name='fftwq_plan_dft_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_dft_2d
type(C_PTR) function fftwq_plan_dft_3d(n0,n1,n2,in,out,sign,flags) bind(C, name='fftwq_plan_dft_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_dft_3d
type(C_PTR) function fftwq_plan_many_dft(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,sign,flags) &
bind(C, name='fftwq_plan_many_dft')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(16), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(16), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_many_dft
type(C_PTR) function fftwq_plan_guru_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftwq_plan_guru_dft')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
complex(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_guru_dft
type(C_PTR) function fftwq_plan_guru_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftwq_plan_guru_split_dft')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: ri
real(16), dimension(*), intent(out) :: ii
real(16), dimension(*), intent(out) :: ro
real(16), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwq_plan_guru_split_dft
type(C_PTR) function fftwq_plan_guru64_dft(rank,dims,howmany_rank,howmany_dims,in,out,sign,flags) &
bind(C, name='fftwq_plan_guru64_dft')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
complex(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: sign
integer(C_INT), value :: flags
end function fftwq_plan_guru64_dft
type(C_PTR) function fftwq_plan_guru64_split_dft(rank,dims,howmany_rank,howmany_dims,ri,ii,ro,io,flags) &
bind(C, name='fftwq_plan_guru64_split_dft')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: ri
real(16), dimension(*), intent(out) :: ii
real(16), dimension(*), intent(out) :: ro
real(16), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwq_plan_guru64_split_dft
subroutine fftwq_execute_dft(p,in,out) bind(C, name='fftwq_execute_dft')
import
type(C_PTR), value :: p
complex(16), dimension(*), intent(inout) :: in
complex(16), dimension(*), intent(out) :: out
end subroutine fftwq_execute_dft
subroutine fftwq_execute_split_dft(p,ri,ii,ro,io) bind(C, name='fftwq_execute_split_dft')
import
type(C_PTR), value :: p
real(16), dimension(*), intent(inout) :: ri
real(16), dimension(*), intent(inout) :: ii
real(16), dimension(*), intent(out) :: ro
real(16), dimension(*), intent(out) :: io
end subroutine fftwq_execute_split_dft
type(C_PTR) function fftwq_plan_many_dft_r2c(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftwq_plan_many_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(16), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
complex(16), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftwq_plan_many_dft_r2c
type(C_PTR) function fftwq_plan_dft_r2c(rank,n,in,out,flags) bind(C, name='fftwq_plan_dft_r2c')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_r2c
type(C_PTR) function fftwq_plan_dft_r2c_1d(n,in,out,flags) bind(C, name='fftwq_plan_dft_r2c_1d')
import
integer(C_INT), value :: n
real(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_r2c_1d
type(C_PTR) function fftwq_plan_dft_r2c_2d(n0,n1,in,out,flags) bind(C, name='fftwq_plan_dft_r2c_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_r2c_2d
type(C_PTR) function fftwq_plan_dft_r2c_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwq_plan_dft_r2c_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_r2c_3d
type(C_PTR) function fftwq_plan_many_dft_c2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,flags) &
bind(C, name='fftwq_plan_many_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
complex(16), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(16), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_INT), value :: flags
end function fftwq_plan_many_dft_c2r
type(C_PTR) function fftwq_plan_dft_c2r(rank,n,in,out,flags) bind(C, name='fftwq_plan_dft_c2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
complex(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_c2r
type(C_PTR) function fftwq_plan_dft_c2r_1d(n,in,out,flags) bind(C, name='fftwq_plan_dft_c2r_1d')
import
integer(C_INT), value :: n
complex(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_c2r_1d
type(C_PTR) function fftwq_plan_dft_c2r_2d(n0,n1,in,out,flags) bind(C, name='fftwq_plan_dft_c2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
complex(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_c2r_2d
type(C_PTR) function fftwq_plan_dft_c2r_3d(n0,n1,n2,in,out,flags) bind(C, name='fftwq_plan_dft_c2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
complex(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_dft_c2r_3d
type(C_PTR) function fftwq_plan_guru_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwq_plan_guru_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_guru_dft_r2c
type(C_PTR) function fftwq_plan_guru_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwq_plan_guru_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
complex(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_guru_dft_c2r
type(C_PTR) function fftwq_plan_guru_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftwq_plan_guru_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: ro
real(16), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwq_plan_guru_split_dft_r2c
type(C_PTR) function fftwq_plan_guru_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftwq_plan_guru_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: ri
real(16), dimension(*), intent(out) :: ii
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_guru_split_dft_c2r
type(C_PTR) function fftwq_plan_guru64_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwq_plan_guru64_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: in
complex(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_guru64_dft_r2c
type(C_PTR) function fftwq_plan_guru64_dft_c2r(rank,dims,howmany_rank,howmany_dims,in,out,flags) &
bind(C, name='fftwq_plan_guru64_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
complex(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_guru64_dft_c2r
type(C_PTR) function fftwq_plan_guru64_split_dft_r2c(rank,dims,howmany_rank,howmany_dims,in,ro,io,flags) &
bind(C, name='fftwq_plan_guru64_split_dft_r2c')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: ro
real(16), dimension(*), intent(out) :: io
integer(C_INT), value :: flags
end function fftwq_plan_guru64_split_dft_r2c
type(C_PTR) function fftwq_plan_guru64_split_dft_c2r(rank,dims,howmany_rank,howmany_dims,ri,ii,out,flags) &
bind(C, name='fftwq_plan_guru64_split_dft_c2r')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: ri
real(16), dimension(*), intent(out) :: ii
real(16), dimension(*), intent(out) :: out
integer(C_INT), value :: flags
end function fftwq_plan_guru64_split_dft_c2r
subroutine fftwq_execute_dft_r2c(p,in,out) bind(C, name='fftwq_execute_dft_r2c')
import
type(C_PTR), value :: p
real(16), dimension(*), intent(inout) :: in
complex(16), dimension(*), intent(out) :: out
end subroutine fftwq_execute_dft_r2c
subroutine fftwq_execute_dft_c2r(p,in,out) bind(C, name='fftwq_execute_dft_c2r')
import
type(C_PTR), value :: p
complex(16), dimension(*), intent(inout) :: in
real(16), dimension(*), intent(out) :: out
end subroutine fftwq_execute_dft_c2r
subroutine fftwq_execute_split_dft_r2c(p,in,ro,io) bind(C, name='fftwq_execute_split_dft_r2c')
import
type(C_PTR), value :: p
real(16), dimension(*), intent(inout) :: in
real(16), dimension(*), intent(out) :: ro
real(16), dimension(*), intent(out) :: io
end subroutine fftwq_execute_split_dft_r2c
subroutine fftwq_execute_split_dft_c2r(p,ri,ii,out) bind(C, name='fftwq_execute_split_dft_c2r')
import
type(C_PTR), value :: p
real(16), dimension(*), intent(inout) :: ri
real(16), dimension(*), intent(inout) :: ii
real(16), dimension(*), intent(out) :: out
end subroutine fftwq_execute_split_dft_c2r
type(C_PTR) function fftwq_plan_many_r2r(rank,n,howmany,in,inembed,istride,idist,out,onembed,ostride,odist,kind,flags) &
bind(C, name='fftwq_plan_many_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
integer(C_INT), value :: howmany
real(16), dimension(*), intent(out) :: in
integer(C_INT), dimension(*), intent(in) :: inembed
integer(C_INT), value :: istride
integer(C_INT), value :: idist
real(16), dimension(*), intent(out) :: out
integer(C_INT), dimension(*), intent(in) :: onembed
integer(C_INT), value :: ostride
integer(C_INT), value :: odist
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwq_plan_many_r2r
type(C_PTR) function fftwq_plan_r2r(rank,n,in,out,kind,flags) bind(C, name='fftwq_plan_r2r')
import
integer(C_INT), value :: rank
integer(C_INT), dimension(*), intent(in) :: n
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwq_plan_r2r
type(C_PTR) function fftwq_plan_r2r_1d(n,in,out,kind,flags) bind(C, name='fftwq_plan_r2r_1d')
import
integer(C_INT), value :: n
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind
integer(C_INT), value :: flags
end function fftwq_plan_r2r_1d
type(C_PTR) function fftwq_plan_r2r_2d(n0,n1,in,out,kind0,kind1,flags) bind(C, name='fftwq_plan_r2r_2d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_INT), value :: flags
end function fftwq_plan_r2r_2d
type(C_PTR) function fftwq_plan_r2r_3d(n0,n1,n2,in,out,kind0,kind1,kind2,flags) bind(C, name='fftwq_plan_r2r_3d')
import
integer(C_INT), value :: n0
integer(C_INT), value :: n1
integer(C_INT), value :: n2
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), value :: kind0
integer(C_FFTW_R2R_KIND), value :: kind1
integer(C_FFTW_R2R_KIND), value :: kind2
integer(C_INT), value :: flags
end function fftwq_plan_r2r_3d
type(C_PTR) function fftwq_plan_guru_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftwq_plan_guru_r2r')
import
integer(C_INT), value :: rank
type(fftwq_iodim), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwq_plan_guru_r2r
type(C_PTR) function fftwq_plan_guru64_r2r(rank,dims,howmany_rank,howmany_dims,in,out,kind,flags) &
bind(C, name='fftwq_plan_guru64_r2r')
import
integer(C_INT), value :: rank
type(fftwq_iodim64), dimension(*), intent(in) :: dims
integer(C_INT), value :: howmany_rank
type(fftwq_iodim64), dimension(*), intent(in) :: howmany_dims
real(16), dimension(*), intent(out) :: in
real(16), dimension(*), intent(out) :: out
integer(C_FFTW_R2R_KIND), dimension(*), intent(in) :: kind
integer(C_INT), value :: flags
end function fftwq_plan_guru64_r2r
subroutine fftwq_execute_r2r(p,in,out) bind(C, name='fftwq_execute_r2r')
import
type(C_PTR), value :: p
real(16), dimension(*), intent(inout) :: in
real(16), dimension(*), intent(out) :: out
end subroutine fftwq_execute_r2r
subroutine fftwq_destroy_plan(p) bind(C, name='fftwq_destroy_plan')
import
type(C_PTR), value :: p
end subroutine fftwq_destroy_plan
subroutine fftwq_forget_wisdom() bind(C, name='fftwq_forget_wisdom')
import
end subroutine fftwq_forget_wisdom
subroutine fftwq_cleanup() bind(C, name='fftwq_cleanup')
import
end subroutine fftwq_cleanup
subroutine fftwq_set_timelimit(t) bind(C, name='fftwq_set_timelimit')
import
real(C_DOUBLE), value :: t
end subroutine fftwq_set_timelimit
subroutine fftwq_plan_with_nthreads(nthreads) bind(C, name='fftwq_plan_with_nthreads')
import
integer(C_INT), value :: nthreads
end subroutine fftwq_plan_with_nthreads
integer(C_INT) function fftwq_planner_nthreads() bind(C, name='fftwq_planner_nthreads')
import
end function fftwq_planner_nthreads
integer(C_INT) function fftwq_init_threads() bind(C, name='fftwq_init_threads')
import
end function fftwq_init_threads
subroutine fftwq_cleanup_threads() bind(C, name='fftwq_cleanup_threads')
import
end subroutine fftwq_cleanup_threads
! Unable to generate Fortran interface for fftwq_threads_set_callback
subroutine fftwq_make_planner_thread_safe() bind(C, name='fftwq_make_planner_thread_safe')
import
end subroutine fftwq_make_planner_thread_safe
integer(C_INT) function fftwq_export_wisdom_to_filename(filename) bind(C, name='fftwq_export_wisdom_to_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftwq_export_wisdom_to_filename
subroutine fftwq_export_wisdom_to_file(output_file) bind(C, name='fftwq_export_wisdom_to_file')
import
type(C_PTR), value :: output_file
end subroutine fftwq_export_wisdom_to_file
type(C_PTR) function fftwq_export_wisdom_to_string() bind(C, name='fftwq_export_wisdom_to_string')
import
end function fftwq_export_wisdom_to_string
subroutine fftwq_export_wisdom(write_char,data) bind(C, name='fftwq_export_wisdom')
import
type(C_FUNPTR), value :: write_char
type(C_PTR), value :: data
end subroutine fftwq_export_wisdom
integer(C_INT) function fftwq_import_system_wisdom() bind(C, name='fftwq_import_system_wisdom')
import
end function fftwq_import_system_wisdom
integer(C_INT) function fftwq_import_wisdom_from_filename(filename) bind(C, name='fftwq_import_wisdom_from_filename')
import
character(C_CHAR), dimension(*), intent(in) :: filename
end function fftwq_import_wisdom_from_filename
integer(C_INT) function fftwq_import_wisdom_from_file(input_file) bind(C, name='fftwq_import_wisdom_from_file')
import
type(C_PTR), value :: input_file
end function fftwq_import_wisdom_from_file
integer(C_INT) function fftwq_import_wisdom_from_string(input_string) bind(C, name='fftwq_import_wisdom_from_string')
import
character(C_CHAR), dimension(*), intent(in) :: input_string
end function fftwq_import_wisdom_from_string
integer(C_INT) function fftwq_import_wisdom(read_char,data) bind(C, name='fftwq_import_wisdom')
import
type(C_FUNPTR), value :: read_char
type(C_PTR), value :: data
end function fftwq_import_wisdom
subroutine fftwq_fprint_plan(p,output_file) bind(C, name='fftwq_fprint_plan')
import
type(C_PTR), value :: p
type(C_PTR), value :: output_file
end subroutine fftwq_fprint_plan
subroutine fftwq_print_plan(p) bind(C, name='fftwq_print_plan')
import
type(C_PTR), value :: p
end subroutine fftwq_print_plan
type(C_PTR) function fftwq_sprint_plan(p) bind(C, name='fftwq_sprint_plan')
import
type(C_PTR), value :: p
end function fftwq_sprint_plan
type(C_PTR) function fftwq_malloc(n) bind(C, name='fftwq_malloc')
import
integer(C_SIZE_T), value :: n
end function fftwq_malloc
type(C_PTR) function fftwq_alloc_real(n) bind(C, name='fftwq_alloc_real')
import
integer(C_SIZE_T), value :: n
end function fftwq_alloc_real
type(C_PTR) function fftwq_alloc_complex(n) bind(C, name='fftwq_alloc_complex')
import
integer(C_SIZE_T), value :: n
end function fftwq_alloc_complex
subroutine fftwq_free(p) bind(C, name='fftwq_free')
import
type(C_PTR), value :: p
end subroutine fftwq_free
subroutine fftwq_flops(p,add,mul,fmas) bind(C, name='fftwq_flops')
import
type(C_PTR), value :: p
real(C_DOUBLE), intent(out) :: add
real(C_DOUBLE), intent(out) :: mul
real(C_DOUBLE), intent(out) :: fmas
end subroutine fftwq_flops
real(C_DOUBLE) function fftwq_estimate_cost(p) bind(C, name='fftwq_estimate_cost')
import
type(C_PTR), value :: p
end function fftwq_estimate_cost
real(C_DOUBLE) function fftwq_cost(p) bind(C, name='fftwq_cost')
import
type(C_PTR), value :: p
end function fftwq_cost
integer(C_INT) function fftwq_alignment_of(p) bind(C, name='fftwq_alignment_of')
import
real(16), dimension(*), intent(out) :: p
end function fftwq_alignment_of
end interface
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
void X(flops)(const X(plan) p, double *add, double *mul, double *fma)
{
planner *plnr = X(the_planner)();
opcnt *o = &p->pln->ops;
*add = o->add; *mul = o->mul; *fma = o->fma;
if (plnr->cost_hook) {
*add = plnr->cost_hook(p->prb, *add, COST_SUM);
*mul = plnr->cost_hook(p->prb, *mul, COST_SUM);
*fma = plnr->cost_hook(p->prb, *fma, COST_SUM);
}
}
double X(estimate_cost)(const X(plan) p)
{
return X(iestimate_cost)(X(the_planner)(), p->pln, p->prb);
}
double X(cost)(const X(plan) p)
{
return p->pln->pcost;
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
void X(forget_wisdom)(void)
{
planner *plnr = X(the_planner)();
plnr->adt->forget(plnr, FORGET_EVERYTHING);
}
#!/usr/bin/perl -w
# Generate Fortran 2003 interfaces from a sequence of C function declarations
# of the form (one per line):
# extern <type> <name>(...args...)
# extern <type> <name>(...args...)
# ...
# with no line breaks within a given function. (It's too much work to
# write a general parser, since we just have to handle FFTW's header files.)
sub canonicalize_type {
my($type);
($type) = @_;
$type =~ s/ +/ /g;
$type =~ s/^ //;
$type =~ s/ $//;
$type =~ s/([^\* ])\*/$1 \*/g;
return $type;
}
# C->Fortran map of supported return types
%return_types = (
"int" => "integer(C_INT)",
"ptrdiff_t" => "integer(C_INTPTR_T)",
"size_t" => "integer(C_SIZE_T)",
"double" => "real(C_DOUBLE)",
"float" => "real(C_FLOAT)",
"long double" => "real(C_LONG_DOUBLE)",
"__float128" => "real(16)",
"fftw_plan" => "type(C_PTR)",
"fftwf_plan" => "type(C_PTR)",
"fftwl_plan" => "type(C_PTR)",
"fftwq_plan" => "type(C_PTR)",
"void *" => "type(C_PTR)",
"char *" => "type(C_PTR)",
"double *" => "type(C_PTR)",
"float *" => "type(C_PTR)",
"long double *" => "type(C_PTR)",
"__float128 *" => "type(C_PTR)",
"fftw_complex *" => "type(C_PTR)",
"fftwf_complex *" => "type(C_PTR)",
"fftwl_complex *" => "type(C_PTR)",
"fftwq_complex *" => "type(C_PTR)",
);
# C->Fortran map of supported argument types
%arg_types = (
"int" => "integer(C_INT), value",
"unsigned" => "integer(C_INT), value",
"size_t" => "integer(C_SIZE_T), value",
"ptrdiff_t" => "integer(C_INTPTR_T), value",
"fftw_r2r_kind" => "integer(C_FFTW_R2R_KIND), value",
"fftwf_r2r_kind" => "integer(C_FFTW_R2R_KIND), value",
"fftwl_r2r_kind" => "integer(C_FFTW_R2R_KIND), value",
"fftwq_r2r_kind" => "integer(C_FFTW_R2R_KIND), value",
"double" => "real(C_DOUBLE), value",
"float" => "real(C_FLOAT), value",
"long double" => "real(C_LONG_DOUBLE), value",
"__float128" => "real(16), value",
"fftw_complex" => "complex(C_DOUBLE_COMPLEX), value",
"fftwf_complex" => "complex(C_DOUBLE_COMPLEX), value",
"fftwl_complex" => "complex(C_LONG_DOUBLE), value",
"fftwq_complex" => "complex(16), value",
"fftw_plan" => "type(C_PTR), value",
"fftwf_plan" => "type(C_PTR), value",
"fftwl_plan" => "type(C_PTR), value",
"fftwq_plan" => "type(C_PTR), value",
"const fftw_plan" => "type(C_PTR), value",
"const fftwf_plan" => "type(C_PTR), value",
"const fftwl_plan" => "type(C_PTR), value",
"const fftwq_plan" => "type(C_PTR), value",
"const int *" => "integer(C_INT), dimension(*), intent(in)",
"ptrdiff_t *" => "integer(C_INTPTR_T), intent(out)",
"const ptrdiff_t *" => "integer(C_INTPTR_T), dimension(*), intent(in)",
"const fftw_r2r_kind *" => "integer(C_FFTW_R2R_KIND), dimension(*), intent(in)",
"const fftwf_r2r_kind *" => "integer(C_FFTW_R2R_KIND), dimension(*), intent(in)",
"const fftwl_r2r_kind *" => "integer(C_FFTW_R2R_KIND), dimension(*), intent(in)",
"const fftwq_r2r_kind *" => "integer(C_FFTW_R2R_KIND), dimension(*), intent(in)",
"double *" => "real(C_DOUBLE), dimension(*), intent(out)",
"float *" => "real(C_FLOAT), dimension(*), intent(out)",
"long double *" => "real(C_LONG_DOUBLE), dimension(*), intent(out)",
"__float128 *" => "real(16), dimension(*), intent(out)",
"fftw_complex *" => "complex(C_DOUBLE_COMPLEX), dimension(*), intent(out)",
"fftwf_complex *" => "complex(C_FLOAT_COMPLEX), dimension(*), intent(out)",
"fftwl_complex *" => "complex(C_LONG_DOUBLE_COMPLEX), dimension(*), intent(out)",
"fftwq_complex *" => "complex(16), dimension(*), intent(out)",
"const fftw_iodim *" => "type(fftw_iodim), dimension(*), intent(in)",
"const fftwf_iodim *" => "type(fftwf_iodim), dimension(*), intent(in)",
"const fftwl_iodim *" => "type(fftwl_iodim), dimension(*), intent(in)",
"const fftwq_iodim *" => "type(fftwq_iodim), dimension(*), intent(in)",
"const fftw_iodim64 *" => "type(fftw_iodim64), dimension(*), intent(in)",
"const fftwf_iodim64 *" => "type(fftwf_iodim64), dimension(*), intent(in)",
"const fftwl_iodim64 *" => "type(fftwl_iodim64), dimension(*), intent(in)",
"const fftwq_iodim64 *" => "type(fftwq_iodim64), dimension(*), intent(in)",
"void *" => "type(C_PTR), value",
"FILE *" => "type(C_PTR), value",
"const char *" => "character(C_CHAR), dimension(*), intent(in)",
"fftw_write_char_func" => "type(C_FUNPTR), value",
"fftwf_write_char_func" => "type(C_FUNPTR), value",
"fftwl_write_char_func" => "type(C_FUNPTR), value",
"fftwq_write_char_func" => "type(C_FUNPTR), value",
"fftw_read_char_func" => "type(C_FUNPTR), value",
"fftwf_read_char_func" => "type(C_FUNPTR), value",
"fftwl_read_char_func" => "type(C_FUNPTR), value",
"fftwq_read_char_func" => "type(C_FUNPTR), value",
# Although the MPI standard defines this type as simply "integer",
# if we use integer without a 'C_' kind in a bind(C) interface then
# gfortran complains. Instead, since MPI also requires the C type
# MPI_Fint to match Fortran integers, we use the size of this type
# (extracted by configure and substituted by the Makefile).
"MPI_Comm" => "integer(C_MPI_FINT), value"
);
while (<>) {
next if /^ *$/;
if (/^ *extern +([a-zA-Z_0-9 ]+[ \*]) *([a-zA-Z_0-9]+) *\((.*)\) *$/) {
$ret = &canonicalize_type($1);
$name = $2;
$args = $3;
$args =~ s/^ *void *$//;
$bad = ($ret ne "void") && !exists($return_types{$ret});
foreach $arg (split(/ *, */, $args)) {
$arg =~ /^([a-zA-Z_0-9 ]+[ \*]) *([a-zA-Z_0-9]+) *$/;
$argtype = &canonicalize_type($1);
$bad = 1 if !exists($arg_types{$argtype});
}
if ($bad) {
print "! Unable to generate Fortran interface for $name\n";
next;
}
# any function taking an MPI_Comm arg needs a C wrapper (grr).
if ($args =~ /MPI_Comm/) {
$cname = $name . "_f03";
}
else {
$cname = $name;
}
# Fortran has a 132-character line-length limit by default (grr)
$len = 0;
print " "; $len = $len + length(" ");
if ($ret eq "void") {
$kind = "subroutine"
}
else {
print "$return_types{$ret} ";
$len = $len + length("$return_types{$ret} ");
$kind = "function"
}
print "$kind $name("; $len = $len + length("$kind $name(");
$len0 = $len;
$argnames = $args;
$argnames =~ s/([a-zA-Z_0-9 ]+[ \*]) *([a-zA-Z_0-9]+) */$2/g;
$comma = "";
foreach $argname (split(/ *, */, $argnames)) {
if ($len + length("$comma$argname") + 3 > 132) {
printf ", &\n%*s", $len0, "";
$len = $len0;
$comma = "";
}
print "$comma$argname";
$len = $len + length("$comma$argname");
$comma = ",";
}
print ") "; $len = $len + 2;
if ($len + length("bind(C, name='$cname')") > 132) {
printf "&\n%*s", $len0 - length("$name("), "";
}
print "bind(C, name='$cname')\n";
print " import\n";
foreach $arg (split(/ *, */, $args)) {
$arg =~ /^([a-zA-Z_0-9 ]+[ \*]) *([a-zA-Z_0-9]+) *$/;
$argtype = &canonicalize_type($1);
$argname = $2;
$ftype = $arg_types{$argtype};
# Various special cases for argument types:
if ($name =~ /_flops$/ && $argtype eq "double *") {
$ftype = "real(C_DOUBLE), intent(out)"
}
if ($name =~ /_execute/ && ($argname eq "ri" ||
$argname eq "ii" ||
$argname eq "in")) {
$ftype =~ s/intent\(out\)/intent(inout)/;
}
print " $ftype :: $argname\n"
}
print " end $kind $name\n";
print " \n";
}
}
#define XGURU(name) X(plan_guru_ ## name)
#define IODIM X(iodim)
#define MKTENSOR_IODIMS X(mktensor_iodims)
#define GURU_KOSHERP X(guru_kosherp)
#define XGURU(name) X(plan_guru64_ ## name)
#define IODIM X(iodim64)
#define MKTENSOR_IODIMS X(mktensor_iodims64)
#define GURU_KOSHERP X(guru64_kosherp)
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
#if defined(FFTW_SINGLE)
# define WISDOM_NAME "wisdomf"
#elif defined(FFTW_LDOUBLE)
# define WISDOM_NAME "wisdoml"
#else
# define WISDOM_NAME "wisdom"
#endif
/* OS-specific configuration-file directory */
#if defined(__DJGPP__)
# define WISDOM_DIR "/dev/env/DJDIR/etc/fftw/"
#else
# define WISDOM_DIR "/etc/fftw/"
#endif
int X(import_system_wisdom)(void)
{
#if defined(__WIN32__) || defined(WIN32) || defined(_WINDOWS)
return 0; /* TODO? */
#else
FILE *f;
f = fopen(WISDOM_DIR WISDOM_NAME, "r");
if (f) {
int ret = X(import_wisdom_from_file)(f);
fclose(f);
return ret;
} else
return 0;
#endif
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
#include <stdio.h>
/* getc()/putc() are *unbelievably* slow on linux. Looks like glibc
is grabbing a lock for each call to getc()/putc(), or something
like that. You pay the price for these idiotic posix threads
whether you use them or not.
So, we do our own buffering. This completely defeats the purpose
of having stdio in the first place, of course.
*/
#define BUFSZ 256
typedef struct {
scanner super;
FILE *f;
char buf[BUFSZ];
char *bufr, *bufw;
} S;
static int getchr_file(scanner * sc_)
{
S *sc = (S *) sc_;
if (sc->bufr >= sc->bufw) {
sc->bufr = sc->buf;
sc->bufw = sc->buf + fread(sc->buf, 1, BUFSZ, sc->f);
if (sc->bufr >= sc->bufw)
return EOF;
}
return *(sc->bufr++);
}
static scanner *mkscanner_file(FILE *f)
{
S *sc = (S *) X(mkscanner)(sizeof(S), getchr_file);
sc->f = f;
sc->bufr = sc->bufw = sc->buf;
return &sc->super;
}
int X(import_wisdom_from_file)(FILE *input_file)
{
scanner *s = mkscanner_file(input_file);
planner *plnr = X(the_planner)();
int ret = plnr->adt->imprt(plnr, s);
X(scanner_destroy)(s);
return ret;
}
int X(import_wisdom_from_filename)(const char *filename)
{
FILE *f = fopen(filename, "r");
int ret;
if (!f) return 0; /* error opening file */
ret = X(import_wisdom_from_file)(f);
if (fclose(f)) ret = 0; /* error closing file */
return ret;
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
typedef struct {
scanner super;
const char *s;
} S_str;
static int getchr_str(scanner * sc_)
{
S_str *sc = (S_str *) sc_;
if (!*sc->s)
return EOF;
return *sc->s++;
}
static scanner *mkscanner_str(const char *s)
{
S_str *sc = (S_str *) X(mkscanner)(sizeof(S_str), getchr_str);
sc->s = s;
return &sc->super;
}
int X(import_wisdom_from_string)(const char *input_string)
{
scanner *s = mkscanner_str(input_string);
planner *plnr = X(the_planner)();
int ret = plnr->adt->imprt(plnr, s);
X(scanner_destroy)(s);
return ret;
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
typedef struct {
scanner super;
int (*read_char)(void *);
void *data;
} S;
static int getchr_generic(scanner * s_)
{
S *s = (S *) s_;
return (s->read_char)(s->data);
}
int X(import_wisdom)(int (*read_char)(void *), void *data)
{
S *s = (S *) X(mkscanner)(sizeof(S), getchr_generic);
planner *plnr = X(the_planner)();
int ret;
s->read_char = read_char;
s->data = data;
ret = plnr->adt->imprt(plnr, (scanner *) s);
X(scanner_destroy)((scanner *) s);
return ret;
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
void *X(malloc)(size_t n)
{
return X(kernel_malloc)(n);
}
void X(free)(void *p)
{
X(kernel_free)(p);
}
/* The following two routines are mainly for the convenience of
the Fortran 2003 API, although C users may find them convienent
as well. The problem is that, although Fortran 2003 has a
c_sizeof intrinsic that is equivalent to sizeof, it is broken
in some gfortran versions, and in any case is a bit unnatural
in a Fortran context. So we provide routines to allocate real
and complex arrays, which are all that are really needed by FFTW. */
R *X(alloc_real)(size_t n)
{
return (R *) X(malloc)(sizeof(R) * n);
}
C *X(alloc_complex)(size_t n)
{
return (C *) X(malloc)(sizeof(C) * n);
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
#include "rdft/rdft.h"
rdft_kind *X(map_r2r_kind)(int rank, const X(r2r_kind) * kind)
{
int i;
rdft_kind *k;
A(FINITE_RNK(rank));
k = (rdft_kind *) MALLOC((unsigned)rank * sizeof(rdft_kind), PROBLEMS);
for (i = 0; i < rank; ++i) {
rdft_kind m;
switch (kind[i]) {
case FFTW_R2HC: m = R2HC; break;
case FFTW_HC2R: m = HC2R; break;
case FFTW_DHT: m = DHT; break;
case FFTW_REDFT00: m = REDFT00; break;
case FFTW_REDFT01: m = REDFT01; break;
case FFTW_REDFT10: m = REDFT10; break;
case FFTW_REDFT11: m = REDFT11; break;
case FFTW_RODFT00: m = RODFT00; break;
case FFTW_RODFT01: m = RODFT01; break;
case FFTW_RODFT10: m = RODFT10; break;
case FFTW_RODFT11: m = RODFT11; break;
default: m = R2HC; A(0);
}
k[i] = m;
}
return k;
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
#include <math.h>
/* a flag operation: x is either a flag, in which case xm == 0, or
a mask, in which case xm == x; using this we can compactly code
the various bit operations via (flags & x) ^ xm or (flags | x) ^ xm. */
typedef struct {
unsigned x, xm;
} flagmask;
typedef struct {
flagmask flag;
flagmask op;
} flagop;
#define FLAGP(f, msk)(((f) & (msk).x) ^ (msk).xm)
#define OP(f, msk)(((f) | (msk).x) ^ (msk).xm)
#define YES(x) {x, 0}
#define NO(x) {x, x}
#define IMPLIES(predicate, consequence) { predicate, consequence }
#define EQV(a, b) IMPLIES(YES(a), YES(b)), IMPLIES(NO(a), NO(b))
#define NEQV(a, b) IMPLIES(YES(a), NO(b)), IMPLIES(NO(a), YES(b))
static void map_flags(unsigned *iflags, unsigned *oflags,
const flagop flagmap[], size_t nmap)
{
size_t i;
for (i = 0; i < nmap; ++i)
if (FLAGP(*iflags, flagmap[i].flag))
*oflags = OP(*oflags, flagmap[i].op);
}
/* encoding of the planner timelimit into a BITS_FOR_TIMELIMIT-bits
nonnegative integer, such that we can still view the integer as
``impatience'': higher means *lower* time limit, and 0 is the
highest possible value (about 1 year of calendar time) */
static unsigned timelimit_to_flags(double timelimit)
{
const double tmax = 365 * 24 * 3600;
const double tstep = 1.05;
const int nsteps = (1 << BITS_FOR_TIMELIMIT);
int x;
if (timelimit < 0 || timelimit >= tmax)
return 0;
if (timelimit <= 1.0e-10)
return nsteps - 1;
x = (int) (0.5 + (log(tmax / timelimit) / log(tstep)));
if (x < 0) x = 0;
if (x >= nsteps) x = nsteps - 1;
return x;
}
void X(mapflags)(planner *plnr, unsigned flags)
{
unsigned l, u, t;
/* map of api flags -> api flags, to implement consistency rules
and combination flags */
const flagop self_flagmap[] = {
/* in some cases (notably for halfcomplex->real transforms),
DESTROY_INPUT is the default, so we need to support
an inverse flag to disable it.
(PRESERVE, DESTROY) -> (PRESERVE, DESTROY)
(0, 0) (1, 0)
(0, 1) (0, 1)
(1, 0) (1, 0)
(1, 1) (1, 0)
*/
IMPLIES(YES(FFTW_PRESERVE_INPUT), NO(FFTW_DESTROY_INPUT)),
IMPLIES(NO(FFTW_DESTROY_INPUT), YES(FFTW_PRESERVE_INPUT)),
IMPLIES(YES(FFTW_EXHAUSTIVE), YES(FFTW_PATIENT)),
IMPLIES(YES(FFTW_ESTIMATE), NO(FFTW_PATIENT)),
IMPLIES(YES(FFTW_ESTIMATE),
YES(FFTW_ESTIMATE_PATIENT
| FFTW_NO_INDIRECT_OP
| FFTW_ALLOW_PRUNING)),
IMPLIES(NO(FFTW_EXHAUSTIVE),
YES(FFTW_NO_SLOW)),
/* a canonical set of fftw2-like impatience flags */
IMPLIES(NO(FFTW_PATIENT),
YES(FFTW_NO_VRECURSE
| FFTW_NO_RANK_SPLITS
| FFTW_NO_VRANK_SPLITS
| FFTW_NO_NONTHREADED
| FFTW_NO_DFT_R2HC
| FFTW_NO_FIXED_RADIX_LARGE_N
| FFTW_BELIEVE_PCOST))
};
/* map of (processed) api flags to internal problem/planner flags */
const flagop l_flagmap[] = {
EQV(FFTW_PRESERVE_INPUT, NO_DESTROY_INPUT),
EQV(FFTW_NO_SIMD, NO_SIMD),
EQV(FFTW_CONSERVE_MEMORY, CONSERVE_MEMORY),
EQV(FFTW_NO_BUFFERING, NO_BUFFERING),
NEQV(FFTW_ALLOW_LARGE_GENERIC, NO_LARGE_GENERIC)
};
const flagop u_flagmap[] = {
IMPLIES(YES(FFTW_EXHAUSTIVE), NO(0xFFFFFFFF)),
IMPLIES(NO(FFTW_EXHAUSTIVE), YES(NO_UGLY)),
/* the following are undocumented, "beyond-guru" flags that
require some understanding of FFTW internals */
EQV(FFTW_ESTIMATE_PATIENT, ESTIMATE),
EQV(FFTW_ALLOW_PRUNING, ALLOW_PRUNING),
EQV(FFTW_BELIEVE_PCOST, BELIEVE_PCOST),
EQV(FFTW_NO_DFT_R2HC, NO_DFT_R2HC),
EQV(FFTW_NO_NONTHREADED, NO_NONTHREADED),
EQV(FFTW_NO_INDIRECT_OP, NO_INDIRECT_OP),
EQV(FFTW_NO_RANK_SPLITS, NO_RANK_SPLITS),
EQV(FFTW_NO_VRANK_SPLITS, NO_VRANK_SPLITS),
EQV(FFTW_NO_VRECURSE, NO_VRECURSE),
EQV(FFTW_NO_SLOW, NO_SLOW),
EQV(FFTW_NO_FIXED_RADIX_LARGE_N, NO_FIXED_RADIX_LARGE_N)
};
map_flags(&flags, &flags, self_flagmap, NELEM(self_flagmap));
l = u = 0;
map_flags(&flags, &l, l_flagmap, NELEM(l_flagmap));
map_flags(&flags, &u, u_flagmap, NELEM(u_flagmap));
/* enforce l <= u */
PLNR_L(plnr) = l;
PLNR_U(plnr) = u | l;
/* assert that the conversion didn't lose bits */
A(PLNR_L(plnr) == l);
A(PLNR_U(plnr) == (u | l));
/* compute flags representation of the timelimit */
t = timelimit_to_flags(plnr->timelimit);
PLNR_TIMELIMIT_IMPATIENCE(plnr) = t;
A(PLNR_TIMELIMIT_IMPATIENCE(plnr) == t);
}
/*
* Copyright (c) 2003, 2007-14 Matteo Frigo
* Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include "api/api.h"
#include <stdio.h>
#define BUFSZ 256
typedef struct {
printer super;
FILE *f;
char buf[BUFSZ];
char *bufw;
} P;
static void myflush(P *p)
{
fwrite(p->buf, 1, p->bufw - p->buf, p->f);
p->bufw = p->buf;
}
static void myputchr(printer *p_, char c)
{
P *p = (P *) p_;
if (p->bufw >= p->buf + BUFSZ)
myflush(p);
*p->bufw++ = c;
}
static void mycleanup(printer *p_)
{
P *p = (P *) p_;
myflush(p);
}
printer *X(mkprinter_file)(FILE *f)
{
P *p = (P *) X(mkprinter)(sizeof(P), myputchr, mycleanup);
p->f = f;
p->bufw = p->buf;
return &p->super;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment