I am working through The NURBS Book by Piegl and Tiller. For the global interpolation algorithm, they require you to provide two utility routines for solving a system of linear equations:
LUDecomposition(A, q, sbw)
to decompose theq x q
coefficient matrix with semibandwidthsbw
into lower and upper triangular components; for simplicity we assumeA
is anq x q
square array, but a utility shoule be used which only stores the nonzero band.
ForwardBackward(A, q, sbw, rhs, sol)
to perform the forward/backward substitution (see [Press88]); rhs[] is the right hand side of the system (the coordinates of the Q_k), and sol[] is the solution vector (coordinates of the P_i).
Checking the reference Press88, I found that it is Numerical Recipes in C. I should be able to rework the algorithm in that book to get the ForwardBackward
function, but as far as the LUDecomposition
goes, where can I find one that works for the special case of a matrix with diagonal bands?