Spline Toolbox | ![]() ![]() |
Syntax
spcol(knots,k,tau) colloc = spcol(knots,k,tau,arg1
,arg2
)
Description
colloc
:= (Dm(i)Bj(tau
(i)))
with Bj the jth B-spline of order k
for the knot sequence knots
, tau
a sequence of sites, assumed to be nondecreasing, and m = knt2mlt(tau)
, i.e.,
m(i) := #{j < i:tau
(j) = tau
(i)}
If one of the optional arguments is a string with the same first two letters as in 'slvblk'
, the matrix is returned in the almost block-diagonal format (specialized for splines) required by slvblk
(and understood by bkbrk
).
If one of the optional arguments is a string with the same first two letters as in 'sparse'
, then the matrix is returned in MATLAB's sparse
format.
If one of the optional arguments is a string with the same first two letters as in 'noderiv'
, multiplicities are ignored, i.e., m(i) = 1 for all i.
Examples
The statement spcol([1:6],3,.1+[2:4])
provides the matrix
ans = 0.5900 0.0050 0 0.4050 0.5900 0.0050 0 0.4050 0.5900
in which the typical row records the values at 2.1, or 3.1, or 4.1, of all B-splines of order 3 for the knot sequence [1:6]
. There are three such B-splines. The first one has knots 1,2,3,4, and its values are recorded in the first column. In particular, the last entry in the first column is zero since it gives the value of that B-spline at 4.1, a site to the right of its last knot.
By adding the optional argument 'sl'
, the output is instead a one-dimensional array containing the same information in storage-saving form. The command bkbrk
decodes this information.
The statement bkbrk(spcol([1:6],3,.1+[2:4],'sl'))
; provides the following detailed information about the block structure of the matrix encoded in the information returned by spcol([1:6],3,.1+[2:4],'sl')
:
block 1 has 2 row(s) 0.5900 0.0050 0 0.4050 0.5900 0.0050 next block is shifted over 1 column(s) block 2 has 1 row(s) 0.4050 0.5900 0.0050 next block is shifted over 2 column(s)
Algorithm
This is the most complex command in this toolbox since it has to deal with various ordering and blocking issues. The recurrence relations are used to generate, simultaneously, the values of all B-splines of order k
having anyone of the tau(i)
in their support.
A separate calculation is carried out for the (presumably few) sites at which derivative values are required. These are the sites tau(i)
with m(i
) > 0. For these, and for every order k
-j, j = j0, j0-1, ...,0, with j0 :=max
(m), values of all B-splines of that order are generated by recurrence and used to compute the jth derivative at those sites of all B-splines of order k
.
The resulting rows of B-spline values (each row corresponding to a particular tau(i)
) are then assembled into the overall (usually rather sparse) matrix.
When the optional argument 'sl'
is present, these rows are instead assembled into a convenient almost block-diagonal form that takes advantage of the fact that, at any site tau(i)
, at most k
B-splines of order k
are nonzero. This fact (together with the natural ordering of the B-splines) implies that the collocation matrix has a staircase shape, with the individual blocks or steps of varying height but of uniform width k
.
The command slvblk
is designed to take advantage of this storage-saving form available when determining the B-form of a piecewise-polynomial function from interpolation or other approximation conditions.
See Also
Limitations
The sequence tau
is assumed to be nondecreasing.
![]() | spaps | spcrv | ![]() |