2
* Copyright (c) 2003, 2006 Matteo Frigo
3
* Copyright (c) 2003, 2006 Massachusetts Institute of Technology
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
/* $Id: nop2.c,v 1.12 2006-01-05 03:04:27 stevenj Exp $ */
23
/* plans for vrank -infty RDFT2s (nothing to do), as well as in-place
24
rank-0 HC2R. Note that in-place rank-0 R2HC is *not* a no-op, because
25
we have to set the imaginary parts of the output to zero. */
29
static void apply(const plan *ego_, R *r, R *rio, R *iio)
37
static int applicable(const solver *ego_, const problem *p_)
39
const problem_rdft2 *p = (const problem_rdft2 *) p_;
43
/* case 1 : -infty vector rank */
44
|| (p->vecsz->rnk == RNK_MINFTY)
46
/* case 2 : rank-0 in-place HC2R rdft */
50
&& FINITE_RNK(p->vecsz->rnk)
51
&& (p->r == p->rio || p->r == p->iio)
52
&& X(rdft2_inplace_strides)(p, RNK_MINFTY)
56
static void print(const plan *ego, printer *p)
59
p->print(p, "(rdft2-nop)");
62
static plan *mkplan(const solver *ego, const problem *p, planner *plnr)
64
static const plan_adt padt = {
65
X(rdft2_solve), X(null_awake), print, X(plan_null_destroy)
71
if (!applicable(ego, p))
73
pln = MKPLAN_RDFT2(plan_rdft2, &padt, apply);
74
X(ops_zero)(&pln->super.ops);
79
static solver *mksolver(void)
81
static const solver_adt sadt = { PROBLEM_RDFT2, mkplan };
82
return MKSOLVER(solver, &sadt);
85
void X(rdft2_nop_register)(planner *p)
87
REGISTER_SOLVER(p, mksolver());