annotate src/fftw-3.3.8/rdft/nop2.c @ 167:bd3cc4d1df30

Add FFTW 3.3.8 source, and a Linux build
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 19 Nov 2019 14:52:55 +0000
parents
children
rev   line source
cannam@167 1 /*
cannam@167 2 * Copyright (c) 2003, 2007-14 Matteo Frigo
cannam@167 3 * Copyright (c) 2003, 2007-14 Massachusetts Institute of Technology
cannam@167 4 *
cannam@167 5 * This program is free software; you can redistribute it and/or modify
cannam@167 6 * it under the terms of the GNU General Public License as published by
cannam@167 7 * the Free Software Foundation; either version 2 of the License, or
cannam@167 8 * (at your option) any later version.
cannam@167 9 *
cannam@167 10 * This program is distributed in the hope that it will be useful,
cannam@167 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cannam@167 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cannam@167 13 * GNU General Public License for more details.
cannam@167 14 *
cannam@167 15 * You should have received a copy of the GNU General Public License
cannam@167 16 * along with this program; if not, write to the Free Software
cannam@167 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
cannam@167 18 *
cannam@167 19 */
cannam@167 20
cannam@167 21
cannam@167 22 /* plans for vrank -infty RDFT2s (nothing to do), as well as in-place
cannam@167 23 rank-0 HC2R. Note that in-place rank-0 R2HC is *not* a no-op, because
cannam@167 24 we have to set the imaginary parts of the output to zero. */
cannam@167 25
cannam@167 26 #include "rdft/rdft.h"
cannam@167 27
cannam@167 28 static void apply(const plan *ego_, R *r0, R *r1, R *cr, R *ci)
cannam@167 29 {
cannam@167 30 UNUSED(ego_);
cannam@167 31 UNUSED(r0);
cannam@167 32 UNUSED(r1);
cannam@167 33 UNUSED(cr);
cannam@167 34 UNUSED(ci);
cannam@167 35 }
cannam@167 36
cannam@167 37 static int applicable(const solver *ego_, const problem *p_)
cannam@167 38 {
cannam@167 39 const problem_rdft2 *p = (const problem_rdft2 *) p_;
cannam@167 40 UNUSED(ego_);
cannam@167 41
cannam@167 42 return(0
cannam@167 43 /* case 1 : -infty vector rank */
cannam@167 44 || (p->vecsz->rnk == RNK_MINFTY)
cannam@167 45
cannam@167 46 /* case 2 : rank-0 in-place rdft, except that
cannam@167 47 R2HC is not a no-op because it sets the imaginary
cannam@167 48 part to 0 */
cannam@167 49 || (1
cannam@167 50 && p->kind != R2HC
cannam@167 51 && p->sz->rnk == 0
cannam@167 52 && FINITE_RNK(p->vecsz->rnk)
cannam@167 53 && (p->r0 == p->cr)
cannam@167 54 && X(rdft2_inplace_strides)(p, RNK_MINFTY)
cannam@167 55 ));
cannam@167 56 }
cannam@167 57
cannam@167 58 static void print(const plan *ego, printer *p)
cannam@167 59 {
cannam@167 60 UNUSED(ego);
cannam@167 61 p->print(p, "(rdft2-nop)");
cannam@167 62 }
cannam@167 63
cannam@167 64 static plan *mkplan(const solver *ego, const problem *p, planner *plnr)
cannam@167 65 {
cannam@167 66 static const plan_adt padt = {
cannam@167 67 X(rdft2_solve), X(null_awake), print, X(plan_null_destroy)
cannam@167 68 };
cannam@167 69 plan_rdft2 *pln;
cannam@167 70
cannam@167 71 UNUSED(plnr);
cannam@167 72
cannam@167 73 if (!applicable(ego, p))
cannam@167 74 return (plan *) 0;
cannam@167 75 pln = MKPLAN_RDFT2(plan_rdft2, &padt, apply);
cannam@167 76 X(ops_zero)(&pln->super.ops);
cannam@167 77
cannam@167 78 return &(pln->super);
cannam@167 79 }
cannam@167 80
cannam@167 81 static solver *mksolver(void)
cannam@167 82 {
cannam@167 83 static const solver_adt sadt = { PROBLEM_RDFT2, mkplan, 0 };
cannam@167 84 return MKSOLVER(solver, &sadt);
cannam@167 85 }
cannam@167 86
cannam@167 87 void X(rdft2_nop_register)(planner *p)
cannam@167 88 {
cannam@167 89 REGISTER_SOLVER(p, mksolver());
cannam@167 90 }