PLaSK library
Loading...
Searching...
No Matches
cosq1b.c
Go to the documentation of this file.
1
/* cosq1b.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
17
static
integer
c__6 = 6;
18
static
integer
c__8 = 8;
19
static
integer
c__10 = 10;
20
static
integer
c_n5 = -5;
21
22
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
23
/* * * */
24
/* * copyright (c) 2011 by UCAR * */
25
/* * * */
26
/* * University Corporation for Atmospheric Research * */
27
/* * * */
28
/* * all rights reserved * */
29
/* * * */
30
/* * FFTPACK version 5.1 * */
31
/* * * */
32
/* * A Fortran Package of Fast Fourier * */
33
/* * * */
34
/* * Subroutines and Example Programs * */
35
/* * * */
36
/* * by * */
37
/* * * */
38
/* * Paul Swarztrauber and Dick Valent * */
39
/* * * */
40
/* * of * */
41
/* * * */
42
/* * the National Center for Atmospheric Research * */
43
/* * * */
44
/* * Boulder, Colorado (80307) U.S.A. * */
45
/* * * */
46
/* * which is sponsored by * */
47
/* * * */
48
/* * the National Science Foundation * */
49
/* * * */
50
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
51
52
/* Subroutine */
int
cosq1b_
(
integer
*
n
,
integer
*inc,
doublereal
*x,
integer
53
*lenx,
doublereal
*wsave,
integer
*
lensav
,
doublereal
*work,
integer
*
54
lenwrk,
integer
*ier)
55
{
56
/* System generated locals */
57
integer
x_dim1, x_offset, i__1;
58
59
/* Builtin functions */
60
double
log(
doublereal
), sqrt(
doublereal
);
61
62
/* Local variables */
63
doublereal
x1;
64
integer
ier1;
65
extern
/* Subroutine */
int
cosqb1_
(
integer
*,
integer
*,
doublereal
*,
66
doublereal
*,
doublereal
*,
integer
*);
67
doublereal
ssqrt2;
68
extern
/* Subroutine */
int
xerfft_
(
char
*,
integer
*,
ftnlen
);
69
70
71
/* Parameter adjustments */
72
x_dim1 = *inc;
73
x_offset = 1 + x_dim1;
74
x -= x_offset;
75
--wsave;
76
--work;
77
78
/* Function Body */
79
*ier = 0;
80
81
if
(*lenx < *inc * (*
n
- 1) + 1) {
82
*ier = 1;
83
xerfft_
(
"COSQ1B"
, &c__6, (
ftnlen
)6);
84
goto
L300;
85
}
else
if
(*
lensav
< (*
n
<< 1) + (
integer
) (log((
doublereal
) (*
n
)) / log(
86
2.)) + 4) {
87
*ier = 2;
88
xerfft_
(
"COSQ1B"
, &c__8, (
ftnlen
)6);
89
goto
L300;
90
}
else
if
(*lenwrk < *
n
) {
91
*ier = 3;
92
xerfft_
(
"COSQ1B"
, &c__10, (
ftnlen
)6);
93
goto
L300;
94
}
95
96
if
((i__1 = *
n
- 2) < 0) {
97
goto
L300;
98
}
else
if
(i__1 == 0) {
99
goto
L102;
100
}
else
{
101
goto
L103;
102
}
103
L102:
104
ssqrt2 = 1. / sqrt(2.);
105
x1 = x[x_dim1 + 1] + x[(x_dim1 << 1) + 1];
106
x[(x_dim1 << 1) + 1] = ssqrt2 * (x[x_dim1 + 1] - x[(x_dim1 << 1) + 1]);
107
x[x_dim1 + 1] = x1;
108
return
0;
109
L103:
110
cosqb1_
(
n
, inc, &x[x_offset], &wsave[1], &work[1], &ier1);
111
if
(ier1 != 0) {
112
*ier = 20;
113
xerfft_
(
"COSQ1B"
, &c_n5, (
ftnlen
)6);
114
}
115
116
L300:
117
return
0;
118
}
/* cosq1b_ */
119
extlib
fftpacx
cosq1b.c
Generated by
1.9.8