~diresu/blender/blender-command-port

« back to all changes in this revision

Viewing changes to extern/fftw/dft/nop.c

  • Committer: theeth
  • Date: 2008-10-14 16:52:04 UTC
  • Revision ID: vcs-imports@canonical.com-20081014165204-r32w2gm6s0osvdhn
copy back trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2003, 2006 Matteo Frigo
 
3
 * Copyright (c) 2003, 2006 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *
 
19
 */
 
20
 
 
21
/* $Id: nop.c,v 1.17 2006-01-05 03:04:26 stevenj Exp $ */
 
22
 
 
23
/* plans for vrank -infty DFTs (nothing to do) */
 
24
 
 
25
#include "dft.h"
 
26
 
 
27
static void apply(const plan *ego_, R *ri, R *ii, R *ro, R *io)
 
28
{
 
29
     UNUSED(ego_);
 
30
     UNUSED(ri);
 
31
     UNUSED(ii);
 
32
     UNUSED(ro);
 
33
     UNUSED(io);
 
34
}
 
35
 
 
36
static int applicable(const solver *ego_, const problem *p_)
 
37
{
 
38
     const problem_dft *p = (const problem_dft *) p_;
 
39
 
 
40
     UNUSED(ego_);
 
41
 
 
42
     return 0
 
43
          /* case 1 : -infty vector rank */
 
44
          || (!FINITE_RNK(p->vecsz->rnk))
 
45
 
 
46
          /* case 2 : rank-0 in-place dft */
 
47
          || (1
 
48
              && p->sz->rnk == 0
 
49
              && FINITE_RNK(p->vecsz->rnk)
 
50
              && p->ro == p->ri
 
51
              && X(tensor_inplace_strides)(p->vecsz)
 
52
               );
 
53
}
 
54
 
 
55
static void print(const plan *ego, printer *p)
 
56
{
 
57
     UNUSED(ego);
 
58
     p->print(p, "(dft-nop)");
 
59
}
 
60
 
 
61
static plan *mkplan(const solver *ego, const problem *p, planner *plnr)
 
62
{
 
63
     static const plan_adt padt = {
 
64
          X(dft_solve), X(null_awake), print, X(plan_null_destroy)
 
65
     };
 
66
     plan_dft *pln;
 
67
 
 
68
     UNUSED(plnr);
 
69
 
 
70
     if (!applicable(ego, p))
 
71
          return (plan *) 0;
 
72
     pln = MKPLAN_DFT(plan_dft, &padt, apply);
 
73
     X(ops_zero)(&pln->super.ops);
 
74
 
 
75
     return &(pln->super);
 
76
}
 
77
 
 
78
static solver *mksolver(void)
 
79
{
 
80
     static const solver_adt sadt = { PROBLEM_DFT, mkplan };
 
81
     return MKSOLVER(solver, &sadt);
 
82
}
 
83
 
 
84
void X(dft_nop_register)(planner *p)
 
85
{
 
86
     REGISTER_SOLVER(p, mksolver());
 
87
}