1
subroutine fourco(t,n,c,alfa,m,ress,resc,wrk1,wrk2,ier)
2
c subroutine fourco calculates the integrals
4
c ress(i) = ! s(x)*sin(alfa(i)*x) dx and
7
c resc(i) = ! s(x)*cos(alfa(i)*x) dx, i=1,...,m,
9
c where s(x) denotes a cubic spline which is given in its
10
c b-spline representation.
13
c call fourco(t,n,c,alfa,m,ress,resc,wrk1,wrk2,ier)
16
c t : real array,length n, containing the knots of s(x).
17
c n : integer, containing the total number of knots. n>=10.
18
c c : real array,length n, containing the b-spline coefficients.
19
c alfa : real array,length m, containing the parameters alfa(i).
20
c m : integer, specifying the number of integrals to be computed.
21
c wrk1 : real array,length n. used as working space
22
c wrk2 : real array,length n. used as working space
25
c ress : real array,length m, containing the integrals ress(i).
26
c resc : real array,length m, containing the integrals resc(i).
28
c ier=0 : normal return.
29
c ier=10: invalid input data (see restrictions).
33
c t(4) < t(5) < ... < t(n-4) < t(n-3).
34
c t(1) <= t(2) <= t(3) <= t(4).
35
c t(n-3) <= t(n-2) <= t(n-1) <= t(n).
37
c other subroutines required: fpbfou,fpcsin
40
c dierckx p. : calculation of fouriercoefficients of discrete
41
c functions using cubic splines. j. computational
42
c and applied mathematics 3 (1977) 207-209.
43
c dierckx p. : curve and surface fitting with splines, monographs on
44
c numerical analysis, oxford university press, 1993.
48
c dept. computer science, k.u.leuven
49
c celestijnenlaan 200a, b-3001 heverlee, belgium.
50
c e-mail : Paul.Dierckx@cs.kuleuven.ac.be
52
c latest update : march 1987
54
c ..scalar arguments..
57
real*8 t(n),c(n),wrk1(n),wrk2(n),alfa(m),ress(m),resc(m)
63
c before starting computations a data check is made. in the input data
64
c are invalid, control is immediately repassed to the calling program.
69
if(t(i).gt.t(i+1)) go to 50
70
if(t(j).lt.t(j-1)) go to 50
74
if(t(i).ge.t(i+1)) go to 50
77
c main loop for the different alfa(i).
79
c calculate the integrals
80
c wrk1(j) = integral(nj,4(x)*sin(alfa*x)) and
81
c wrk2(j) = integral(nj,4(x)*cos(alfa*x)), j=1,2,...,n-4,
82
c where nj,4(x) denotes the normalised cubic b-spline defined on the
83
c knots t(j),t(j+1),...,t(j+4).
84
call fpbfou(t,n,alfa(i),wrk1,wrk2)
85
c calculate the integrals ress(i) and resc(i).