pttools.speedup.fitpack

Functions from the SciPy version of FITPACK.

These don’t work yet and are therefore not used.

Functions

pttools.speedup.fitpack.fpbspl(t, n, k, x, l, h)

Modified from the SciPy version.

c subroutine fpbspl evaluates the (k+1) non-zero b-splines of c degree k at t(l) <= x < t(l+1) using the stable recurrence c relation of de boor and cox. c Travis Oliphant 2007 c changed so that weighting of 0 is used when knots with c multiplicity are present. c Also, notice that l+k <= n and 1 <= l+1-k c or else the routine will be accessing memory outside t c Thus it is imperative that that k <= l <= n-k but this c is not checked.

Parameters:
  • t (ndarray) – position of the knots (length n)

  • n (int) – total number of knots

  • k (int) – degree of the spline

  • x (float) –

    ?

  • l (int) –

    ?

  • h (ndarray) –

    ?

pttools.speedup.fitpack.splder(t, n, c, k, nu, x, y, m, e, wrk)

Modified from the SciPy version.

subroutine splder evaluates in a number of points x(i),i=1,2,…,m the derivative of order nu of a spline s(x) of degree k,given in its b-spline representation.

input parameters:

Parameters:
  • t (ndarray) – array,length n, which contains the position of the knots.

  • n (int) – integer, giving the total number of knots of s(x).

  • c (ndarray) – array,length n, which contains the b-spline coefficients.

  • k (int) – integer, giving the degree of s(x).

  • nu (int) – integer, specifying the order of the derivative. 0<=nu<=k

  • x (ndarray) – array,length m, which contains the points where the derivative of s(x) must be evaluated.

  • m (int) – integer, giving the number of points where the derivative of s(x) must be evaluated

  • e (int) – integer, if 0 the spline is extrapolated from the end spans for points not in the support, if 1 the spline evaluates to zero for those points, and if 2 ier is set to 1 and the subroutine returns.

  • wrk (ndarray) – real array of dimension n. used as working space.

  • y (ndarray) – array,length m, giving the value of the derivative of s(x) at the different points.

Returns:

ier, error flag ier = 0 : normal return ier = 1 : argument out of bounds and e == 2 ier =10 : invalid input data (see restrictions)

Return type:

int

restrictions:

0 <= nu <= k m >= 1 t(k+1) <= x(i) <= x(i+1) <= t(n-k) , i=1,2,…,m-1.

other subroutines required: fpbspl

references:
de boor con calculating with b-splines, j. approximation theory

6 (1972) 50-62.

cox m.g.the numerical evaluation of b-splines, j. inst. maths

applics 10 (1972) 134-149.

dierckx p.curve and surface fitting with splines, monographs on

numerical analysis, oxford university press, 1993.

author:

p.dierckx dept. computer science, k.u.leuven celestijnenlaan 200a, b-3001 heverlee, belgium. e-mail : Paul.Dierckx@cs.kuleuven.ac.be

latest update : march 1987

++ pearu: 13 aug 20003 ++ - disabled cliping x values to interval [min(t),max(t)] ++ - removed the restriction of the orderness of x values ++ - fixed initialization of sp to double precision value

pttools.speedup.fitpack.splev(t, n, c, k, x, y, m, e)

Modified from the SciPy version.

subroutine splev evaluates in a number of points x(i),i=1,2,…,m a spline s(x) of degree k, given in its b-spline representation.

Parameters:
  • t (ndarray) – array,length n, which contains the position of the knots.

  • n (int) – integer, giving the total number of knots of s(x).

  • c (ndarray) – array,length n, which contains the b-spline coefficients.

  • k (int) – integer, giving the degree of s(x).

  • x (ndarray) – array,length m, which contains the points where s(x) must be evaluated.

  • m (int) – integer, giving the number of points where s(x) must be evaluated.

  • e (int) – integer, if 0 the spline is extrapolated from the end spans for points not in the support, if 1 the spline evaluates to zero for those points, if 2 ier is set to 1 and the subroutine returns, and if 3 the spline evaluates to the value of the nearest boundary point.

  • y (ndarray) – array,length m, giving the value of s(x) at the different points.

Returns:

ier, error flag ier = 0 : normal return ier = 1 : argument out of bounds and e == 2 ier =10 : invalid input data (see restrictions)

Return type:

int

restrictions:

m >= 1 – t(k+1) <= x(i) <= x(i+1) <= t(n-k) , i=1,2,…,m-1.

other subroutines required: fpbspl.

references :
de boor con calculating with b-splines, j. approximation theory

6 (1972) 50-62.

cox m.g.the numerical evaluation of b-splines, j. inst. maths

applics 10 (1972) 134-149.

dierckx p.curve and surface fitting with splines, monographs on

numerical analysis, oxford university press, 1993.

author :

p.dierckx dept. computer science, k.u.leuven celestijnenlaan 200a, b-3001 heverlee, belgium. e-mail : Paul.Dierckx@cs.kuleuven.ac.be

latest update : march 1987

++ pearu: 11 aug 2003 ++ - disabled cliping x values to interval [min(t),max(t)] ++ - removed the restriction of the orderness of x values ++ - fixed initialization of sp to double precision value