PLaSK library
Loading...
Searching...
No Matches
sinqmf.c
Go to the documentation of this file.
1/* sinqmf.f -- translated by f2c (version 20100827).
2 You must link the resulting object file with libf2c:
3 on Microsoft Windows system, link with libf2c.lib;
4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 or, if you install libf2c.a in a standard place, with -lf2c -lm
6 -- in that order, at the end of the command line, as in
7 cc *.o -lf2c -lm
8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10 http://www.netlib.org/f2c/libf2c.zip
11*/
12
13#include "f2c.h"
14
15/* Table of constant values */
16
17static integer c__6 = 6;
18static integer c__8 = 8;
19static integer c__10 = 10;
20static integer c_n1 = -1;
21static integer c_n5 = -5;
22
23/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24/* * * */
25/* * copyright (c) 2011 by UCAR * */
26/* * * */
27/* * University Corporation for Atmospheric Research * */
28/* * * */
29/* * all rights reserved * */
30/* * * */
31/* * FFTPACK version 5.1 * */
32/* * * */
33/* * A Fortran Package of Fast Fourier * */
34/* * * */
35/* * Subroutines and Example Programs * */
36/* * * */
37/* * by * */
38/* * * */
39/* * Paul Swarztrauber and Dick Valent * */
40/* * * */
41/* * of * */
42/* * * */
43/* * the National Center for Atmospheric Research * */
44/* * * */
45/* * Boulder, Colorado (80307) U.S.A. * */
46/* * * */
47/* * which is sponsored by * */
48/* * * */
49/* * the National Science Foundation * */
50/* * * */
51/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
52
53/* Subroutine */ int sinqmf_(integer *lot, integer *jump, integer *n, integer
54 *inc, doublereal *x, integer *lenx, doublereal *wsave, integer *
55 lensav, doublereal *work, integer *lenwrk, integer *ier)
56{
57 /* System generated locals */
58 integer x_dim1, x_offset, i__1, i__2, i__3;
59
60 /* Builtin functions */
61 double log(doublereal);
62
63 /* Local variables */
64 integer k, m, kc, lj, ns2, ier1;
65 doublereal xhold;
66 extern /* Subroutine */ int cosqmf_(integer *, integer *, integer *,
68 doublereal *, integer *, integer *);
69 extern logical xercon_(integer *, integer *, integer *, integer *);
70 extern /* Subroutine */ int xerfft_(char *, integer *, ftnlen);
71
72
73 /* Parameter adjustments */
74 x_dim1 = *inc;
75 x_offset = 1 + x_dim1;
76 x -= x_offset;
77 --wsave;
78 --work;
79
80 /* Function Body */
81 *ier = 0;
82
83 if (*lenx < (*lot - 1) * *jump + *inc * (*n - 1) + 1) {
84 *ier = 1;
85 xerfft_("SINQMF", &c__6, (ftnlen)6);
86 goto L300;
87 } else if (*lensav < (*n << 1) + (integer) (log((doublereal) (*n)) / log(
88 2.)) + 4) {
89 *ier = 2;
90 xerfft_("SINQMF", &c__8, (ftnlen)6);
91 goto L300;
92 } else if (*lenwrk < *lot * *n) {
93 *ier = 3;
94 xerfft_("SINQMF", &c__10, (ftnlen)6);
95 goto L300;
96 } else if (! xercon_(inc, jump, n, lot)) {
97 *ier = 4;
98 xerfft_("SINQMF", &c_n1, (ftnlen)6);
99 goto L300;
100 }
101
102 if (*n == 1) {
103 return 0;
104 }
105 ns2 = *n / 2;
106 lj = (*lot - 1) * *jump + 1;
107 i__1 = ns2;
108 for (k = 1; k <= i__1; ++k) {
109 kc = *n - k;
110 i__2 = lj;
111 i__3 = *jump;
112 for (m = 1; i__3 < 0 ? m >= i__2 : m <= i__2; m += i__3) {
113 xhold = x[m + k * x_dim1];
114 x[m + k * x_dim1] = x[m + (kc + 1) * x_dim1];
115 x[m + (kc + 1) * x_dim1] = xhold;
116/* L201: */
117 }
118/* L101: */
119 }
120 cosqmf_(lot, jump, n, inc, &x[x_offset], lenx, &wsave[1], lensav, &work[1]
121 , lenwrk, &ier1);
122 if (ier1 != 0) {
123 *ier = 20;
124 xerfft_("SINQMF", &c_n5, (ftnlen)6);
125 goto L300;
126 }
127 i__1 = *n;
128 for (k = 2; k <= i__1; k += 2) {
129 i__3 = lj;
130 i__2 = *jump;
131 for (m = 1; i__2 < 0 ? m >= i__3 : m <= i__3; m += i__2) {
132 x[m + k * x_dim1] = -x[m + k * x_dim1];
133/* L202: */
134 }
135/* L102: */
136 }
137L300:
138 return 0;
139} /* sinqmf_ */
140