dsinqi(3P)
NAME
dsinqi - initialize the array xWSAVE, which is used in both xSINQF and xSINQB.
SYNOPSIS
SUBROUTINE SINQI (N, RWSAVE)
SUBROUTINE DSINQI (N, DWSAVE)
SUBROUTINE VSINQI (N, RWSAVE)
SUBROUTINE VDSINQI (N, DWSAVE)
#include <sunperf.h>
void sinqi (int n, float ∗rwsave) ;
void dsinqi (int n, double ∗dwsave) ;
void vsinqi (int n, float ∗rwsave) ;
void vdsinqi (int n, float ∗dwsave) ;
ARGUMENTS
N Length of the sequence to be transformed. The method is most efficient when N is a product of small primes.
xWSAVE On entry, an array with a dimension of at least (3 ∗ N + 15) for scalar subroutines or (2 ∗ N + 15) for vector subroutines. The same work array can be used for both xSINQF and xSINQB as long as N remains unchanged. Different xWSAVE arrays are required for different values of N. This initialization does not have to be repeated between calls to xCSINF or xCSINB as long as N and xWSAVE remain unchanged, thus subsequent transforms can be obtained faster than the first.
SAMPLE PROGRAM
PROGRAM TEST
IMPLICIT NONE
C
INTEGER N
PARAMETER (N = 6)
C
INTEGER I
REAL PI, WSAVE(3 ∗ N + 15), X(N)
C
EXTERNAL SINQB, SINQF, SINQI
INTRINSIC ACOS, SIN
C
C Initialize array X to a real odd quarter-wave sequence,
C that is,it can be expanded in terms of a sine series with
C only odd wave number.
C
PI = ACOS (-1.0)
DO 100, I=1, N
X(I) = 40.0 ∗ SIN (I ∗ PI / (2.0 ∗ N))
100 CONTINUE
C
PRINT 1000
PRINT 1010, (X(I), I = 1, N)
CALL SINQI (N, WSAVE)
CALL SINQF (N, X, WSAVE)
PRINT 1020
PRINT 1010, (X(I), I = 1, N)
CALL SINQB(N, X, WSAVE)
PRINT 1030
PRINT 1010, (X(I), I = 1, N)
C
1000 FORMAT (1X, ’Original Sequence: ’)
1010 FORMAT (1X, 100(F5.1, 1X))
1020 FORMAT (1X, ’Transformed Sequence: ’)
1030 FORMAT (1X, ’Recovered Sequence: ’)
C
END
SAMPLE OUTPUT
Original Sequence:
10.4 20.0 28.3 34.6 38.6 40.0
Transformed Sequence:
240.0 0.0 0.0 0.0 0.0 0.0
Recovered Sequence:
248.5 480.0 678.8 831.4 927.3 960.0
SunOS 5.0 — Last change: 10 Dec 1998