~ubuntu-branches/ubuntu/karmic/python-scipy/karmic

« back to all changes in this revision

Viewing changes to Lib/interpolate/fitpack/spalde.f

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T. Chen (new)
  • Date: 2005-03-16 02:15:29 UTC
  • Revision ID: james.westby@ubuntu.com-20050316021529-xrjlowsejs0cijig
Tags: upstream-0.3.2
ImportĀ upstreamĀ versionĀ 0.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
      subroutine spalde(t,n,c,k1,x,d,ier)
 
2
c  subroutine spalde evaluates at a point x all the derivatives
 
3
c              (j-1)
 
4
c      d(j) = s     (x) , j=1,2,...,k1
 
5
c  of a spline s(x) of order k1 (degree k=k1-1), given in its b-spline
 
6
c  representation.
 
7
c
 
8
c  calling sequence:
 
9
c     call spalde(t,n,c,k1,x,d,ier)
 
10
c
 
11
c  input parameters:
 
12
c    t    : array,length n, which contains the position of the knots.
 
13
c    n    : integer, giving the total number of knots of s(x).
 
14
c    c    : array,length n, which contains the b-spline coefficients.
 
15
c    k1   : integer, giving the order of s(x) (order=degree+1)
 
16
c    x    : real, which contains the point where the derivatives must
 
17
c           be evaluated.
 
18
c
 
19
c  output parameters:
 
20
c    d    : array,length k1, containing the derivative values of s(x).
 
21
c    ier  : error flag
 
22
c      ier = 0 : normal return
 
23
c      ier =10 : invalid input data (see restrictions)
 
24
c
 
25
c  restrictions:
 
26
c    t(k1) <= x <= t(n-k1+1)
 
27
c
 
28
c  further comments:
 
29
c    if x coincides with a knot, right derivatives are computed
 
30
c    ( left derivatives if x = t(n-k1+1) ).
 
31
c
 
32
c  other subroutines required: fpader.
 
33
c
 
34
c  references :
 
35
c    de boor c : on calculating with b-splines, j. approximation theory
 
36
c                6 (1972) 50-62.
 
37
c    cox m.g.  : the numerical evaluation of b-splines, j. inst. maths
 
38
c                applics 10 (1972) 134-149.
 
39
c   dierckx p. : curve and surface fitting with splines, monographs on
 
40
c                numerical analysis, oxford university press, 1993.
 
41
c
 
42
c  author :
 
43
c    p.dierckx
 
44
c    dept. computer science, k.u.leuven
 
45
c    celestijnenlaan 200a, b-3001 heverlee, belgium.
 
46
c    e-mail : Paul.Dierckx@cs.kuleuven.ac.be
 
47
c
 
48
c  latest update : march 1987
 
49
c
 
50
c  ..scalar arguments..
 
51
      integer n,k1,ier
 
52
      real*8 x
 
53
c  ..array arguments..
 
54
      real*8 t(n),c(n),d(k1)
 
55
c  ..local scalars..
 
56
      integer l,nk1
 
57
c  ..
 
58
c  before starting computations a data check is made. if the input data
 
59
c  are invalid control is immediately repassed to the calling program.
 
60
      ier = 10
 
61
      nk1 = n-k1
 
62
      if(x.lt.t(k1) .or. x.gt.t(nk1+1)) go to 300
 
63
c  search for knot interval t(l) <= x < t(l+1)
 
64
      l = k1
 
65
 100  if(x.lt.t(l+1) .or. l.eq.nk1) go to 200
 
66
      l = l+1
 
67
      go to 100
 
68
 200  if(t(l).ge.t(l+1)) go to 300
 
69
      ier = 0
 
70
c  calculate the derivatives.
 
71
      call fpader(t,n,c,k1,x,l,d)
 
72
 300  return
 
73
      end