From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- math/deboor/setdat.f | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 math/deboor/setdat.f (limited to 'math/deboor/setdat.f') diff --git a/math/deboor/setdat.f b/math/deboor/setdat.f new file mode 100644 index 00000000..40012a38 --- /dev/null +++ b/math/deboor/setdat.f @@ -0,0 +1,41 @@ + subroutine setdat(icount) +c from * a practical guide to splines * by c. de boor +c to be called in main program l 2 m a i n . +c this routine is set up to provide the specific data for example 2 +c in chapter xiv. for a general purpose l2-approximation program, it +c would have to be replaced by a subroutine reading in +c ntau, tau(i), gtau(i), i=1,...,ntau +c and reading in or setting +c k, l, break(i),i=1,...,l+1, and weight(i),i=1,...,ntau, +c as well as totalw = sum( weight(i) , i=1,...,ntau). +c i c o u n t is equal to zero when setdat is called in l 2 m a i n +c for the first time. after that, it is up to setdat to use icount +c for keeping track of the passes through setdat . this is important +c since l2main relies on setdat for t e r m i n a t i o n . + integer icount, i,k,l,lp1,ntau,ntaum1 + real break,coef,gtau,step,tau,totalw,weight +c parameter lpkmax=100,ntmax=200,ltkmax=2000 +c common / data / ntau, tau(ntmax),gtau(ntmax),weight(ntmax),totalw +c common /approx/ break(lpkmax),coef(ltkmax),l,k + common / data / ntau, tau(200),gtau(200),weight(200),totalw + common /approx/ break(100),coef(2000),l,k + if (icount .gt. 0) stop + icount = icount + 1 + ntau = 10 + ntaum1 = ntau-1 + do 8 i=1,ntaum1 + 8 tau(i) = 1. - .5**(i-1) + tau(ntau) = 1. + do 9 i=1,ntau + 9 gtau(i) = tau(i)**2 + 1. + do 10 i=1,ntau + 10 weight(i) = 1. + totalw = ntau + l = 6 + lp1 = l+1 + step = 1./float(l) + k = 2 + do 11 i=1,lp1 + 11 break(i) = (i-1)*step + return + end -- cgit