comparison src/fftw-3.3.5/dft/nop.c @ 42:2cd0e3b3e1fd

Current fftw source
author Chris Cannam
date Tue, 18 Oct 2016 13:40:26 +0100
parents
children
comparison
equal deleted inserted replaced
41:481f5f8c5634 42:2cd0e3b3e1fd
1 /*
2 * Copyright (c) 2003, 2007-14 Matteo Frigo
3 * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 */
20
21
22 /* plans for vrank -infty DFTs (nothing to do) */
23
24 #include "dft.h"
25
26 static void apply(const plan *ego_, R *ri, R *ii, R *ro, R *io)
27 {
28 UNUSED(ego_);
29 UNUSED(ri);
30 UNUSED(ii);
31 UNUSED(ro);
32 UNUSED(io);
33 }
34
35 static int applicable(const solver *ego_, const problem *p_)
36 {
37 const problem_dft *p = (const problem_dft *) p_;
38
39 UNUSED(ego_);
40
41 return 0
42 /* case 1 : -infty vector rank */
43 || (!FINITE_RNK(p->vecsz->rnk))
44
45 /* case 2 : rank-0 in-place dft */
46 || (1
47 && p->sz->rnk == 0
48 && FINITE_RNK(p->vecsz->rnk)
49 && p->ro == p->ri
50 && X(tensor_inplace_strides)(p->vecsz)
51 );
52 }
53
54 static void print(const plan *ego, printer *p)
55 {
56 UNUSED(ego);
57 p->print(p, "(dft-nop)");
58 }
59
60 static plan *mkplan(const solver *ego, const problem *p, planner *plnr)
61 {
62 static const plan_adt padt = {
63 X(dft_solve), X(null_awake), print, X(plan_null_destroy)
64 };
65 plan_dft *pln;
66
67 UNUSED(plnr);
68
69 if (!applicable(ego, p))
70 return (plan *) 0;
71 pln = MKPLAN_DFT(plan_dft, &padt, apply);
72 X(ops_zero)(&pln->super.ops);
73
74 return &(pln->super);
75 }
76
77 static solver *mksolver(void)
78 {
79 static const solver_adt sadt = { PROBLEM_DFT, mkplan, 0 };
80 return MKSOLVER(solver, &sadt);
81 }
82
83 void X(dft_nop_register)(planner *p)
84 {
85 REGISTER_SOLVER(p, mksolver());
86 }