File: spalde.f

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