C Library Functions  - splopt (3)

from * a practical guide to splines * by c. de boor alls bsplvb, banfac/slv
omputes the knots
  t for the optimal recovery scheme of order k
for data at
  tau(i), i=1,...,n .
****** i n p u t ******
tau.....array of length
  n , containing the interpolation points.
a s s u m e d
  to be nondecreasing, with tau(i).lt.tau(i+k),all i. n.....number of data points . k.....order of the optimal recovery scheme to be used .
****** w o r k a r r a y *****
scrtch.....array of length
  (n-k)(2k+3) + 5k + 3 . the various contents are specified in the text below .
****** o u t p u t ****** iflag.....integer indicating success (=1) or failure (=2) . if iflag = 1, then
t.....array of length
  n+k containing the optimal knots ready for
use in optimal recovery. specifically,
  t(1) = ... = t(k) =
tau(1) and t(n+1) = ... = t(n+k) = tau(n) , while the n-k
interior knots
  t(k+1), ..., t(n) are calculated as described
below under
  *method* . if iflag = 2, then k .lt. 3, or n .lt. k, or a certain linear system was found to be singular.
****** p r i n t e d o u t p u t ******
a comment will be printed in case
  iflag = 2 or newton iterations
failed to converge in
  n e w t m x iterations .
****** m e t h o d ******
the (interior) knots
  t(k+1), ..., t(n) are determined by newtons method in such a way that the signum function which changes sign at
t(k+1), ..., t(n)
  and nowhere else in (tau(1),tau(n)) is orthogon-
al to the spline space
  spline( k , tau ) on that interval .
let xi(j) be the current guess for t(k+j), j=1,...,n-k. then the next newton iterate is of the form
xi(j) + (-)**(n-k-j)*x(j) , j=1,...,n-k,
with x the solution of the linear system
c*x = d .
here, c(i,j) = b(i)(xi(j)), all j, with b(i) the i-th b-spline of
order k for the knot sequence tau , all i, and d is the vector
given by
  d(i) = sum( -a(j) , j=i,...,n )*(tau(i+k)-tau(i))/k, all i,
with a(i) = sum ( (-)**(n-k-j)*b(i,k+1,tau)(xi(j)) , j=1,...,n-k )
for i=1,...,n-1, and
  a(n) = -.5 .
(see chapter
  xiii of text and references there for a derivation)
the first guess for
  t(k+j) is (tau(j+1)+...+tau(j+k-1))/(k-1) .
iteration terminates if
  max(abs(x(j))) .lt. t o l , with
t o l = t o l r t e *(tau(n)-tau(1))/(n-k) ,
or else after
  n e w t m x iterations , currently, newtmx, tolrte / 10, .000001

dimension scrtch((n-k)*(2*k+3)+5*k+3), t(n+k) current fortran standard makes it impossible to specify the precise dim-

ensions of
  scrtch and t without the introduction of otherwise superfluous additional arguments .


Nemo Release 3.1 splopt (3) June 29, 2025
Generated by manServer 1.08 from a76b1647-dc3b-4658-a48b-94843d135e86 using man macros.