Determines the parameters of a function that interpolates History
Evaluates the tensor product piecewise polynomial History
Determines the parameters of a function that interpolates History
Evaluates the tensor product piecewise polynomial History
Check the validity of the inputs to the "ink" routines. Notes
The code is new, but the logic is based on the original logic in the CMLIB routines db2ink and db3ink.
History
dbknot chooses a knot sequence for interpolation of order k at the History
dbtpcf computes b-spline interpolation coefficients for nf sets History
dbintk produces the b-spline coefficients, bcoef, of the Error conditions
History
Returns in w the LU-factorization (without pivoting) of the banded Work array
Input
w array of size (nroww,nrow) contains the interesting part of a banded matrix a , with the diagonals or bands of a stored in the rows of w , while columns of a correspond to columns of w . this is the storage mode used in linpack and results in efficient innermost loops. explicitly, a has nbandl bands below the diagonal + 1 (main) diagonal + nbandu bands above the diagonal and thus, with middle = nbandu + 1, a(i+j,j) is in w(i+middle,j) for i=-nbandu,...,nbandl j=1,...,nrow . for example, the interesting entries of a (1,2)-banded matrix of order 9 would appear in the first 1+1+2 = 4 rows of w as follows. 13 24 35 46 57 68 79 12 23 34 45 56 67 78 89 11 22 33 44 55 66 77 88 99 21 32 43 54 65 76 87 98 all other entries of w not identified in this way with an en- try of a are never referenced .
Output
History
Companion routine to dbnfac. it returns the solution x of the History
Calculates the value of all (possibly) nonzero basis Error Conditions
History
Evaluates the b-representation (t,a,n,k) of a b-spline Error Conditions
History
Computes the largest integer ileft in 1 <= ileft <= lxt History
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | wp | = | real64 | Real precision |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(:) | :: | t | knot vector of length n+k |
|
real(kind=wp), | intent(in), | dimension(n) | :: | a | b-spline coefficient vector of length n |
|
integer, | intent(in) | :: | n | number of b-spline coefficients. (sum of knot multiplicities-k) |
||
integer, | intent(in) | :: | k | order of the b-spline, k >= 1 |
||
integer, | intent(in) | :: | ideriv | order of the derivative, 0 <= ideriv <= k-1. ideriv = 0 returns the b-spline value |
||
real(kind=wp), | intent(in) | :: | x | argument, t(k) <= x <= t(n+1) |
||
integer, | intent(inout) | :: | inbv | an initialization parameter which must be set to 1 the first time dbvalu is called. inbv contains information for efficient process- ing after the initial call and inbv must not be changed by the user. distinct splines require distinct inbv parameters. |
||
real(kind=wp), | dimension(:) | :: | work | work vector of length 3*k |
||
integer, | intent(out) | :: | iflag |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(nx) | :: | x | Array of x abcissae. Must be strictly increasing. |
|
integer, | intent(in) | :: | nx | Number of x abcissae |
||
real(kind=wp), | intent(in), | dimension(nx) | :: | fcn | Array of function values to interpolate. fcn(i) should contain the function value at the point x(i) |
|
integer, | intent(in) | :: | kx | The order of spline pieces in x (>= 2, < nx). (order = polynomial degree + 1) |
||
real(kind=wp), | intent(inout), | dimension(nx+kx) | :: | tx | The knots in the x direction for the spline interpolant. If iflag=0 these are chosen by db1ink. If iflag=1 these are specified by the user. Must be non-decreasing. |
|
real(kind=wp), | intent(out), | dimension(nx) | :: | bcoef | Array of coefficients of the b-spline interpolant. |
|
integer, | intent(inout) | :: | iflag | on input: 0 = knot sequence chosen by db1ink. 1 = knot sequence chosen by user. on output: 1 = successful execution. 2 = iflag out of range. 3 = nx out of range. 4 = kx out of range. 5 = x not strictly increasing. 6 = tx not non-decreasing. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | xval | x coordinate of evaluation point. |
||
integer, | intent(in) | :: | idx | x derivative of piecewise polynomial to evaluate. |
||
real(kind=wp), | intent(in), | dimension(nx+kx) | :: | tx | sequence of knots defining the piecewise polynomial in the x direction. (same as in last call to db1ink) |
|
integer, | intent(in) | :: | nx | the number of interpolation points in x. (same as in last call to db1ink) |
||
integer, | intent(in) | :: | kx | order of polynomial pieces in x. (same as in last call to db1ink) |
||
real(kind=wp), | intent(in), | dimension(nx) | :: | bcoef | the b-spline coefficients computed by db1ink. |
|
real(kind=wp), | intent(out) | :: | f | interpolated value |
||
integer, | intent(out) | :: | iflag | status flag: 0 : no errors, /=0 : error |
||
integer, | intent(inout) | :: | inbvx | initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(nx) | :: | x | Array of x abcissae. Must be strictly increasing. |
|
integer, | intent(in) | :: | nx | Number of x abcissae |
||
real(kind=wp), | intent(in), | dimension(ny) | :: | y | Array of y abcissae. Must be strictly increasing. |
|
integer, | intent(in) | :: | ny | Number of y abcissae |
||
real(kind=wp), | intent(in), | dimension(nx,ny) | :: | fcn | Array of function values to interpolate. fcn(i,j) should contain the function value at the point (x(i),y(j)) |
|
integer, | intent(in) | :: | kx | The order of spline pieces in x (>= 2, < nx). (order = polynomial degree + 1) |
||
integer, | intent(in) | :: | ky | The order of spline pieces in y (>= 2, < ny). (order = polynomial degree + 1) |
||
real(kind=wp), | intent(inout), | dimension(nx+kx) | :: | tx | The knots in the x direction for the spline interpolant. If iflag=0 these are chosen by db2ink. If iflag=1 these are specified by the user. Must be non-decreasing. |
|
real(kind=wp), | intent(inout), | dimension(ny+ky) | :: | ty | The knots in the y direction for the spline interpolant. If iflag=0 these are chosen by db2ink. If iflag=1 these are specified by the user. Must be non-decreasing. |
|
real(kind=wp), | intent(out), | dimension(nx,ny) | :: | bcoef | Array of coefficients of the b-spline interpolant. |
|
integer, | intent(inout) | :: | iflag | on input: 0 = knot sequence chosen by db2ink. 1 = knot sequence chosen by user. on output: 1 = successful execution. 2 = iflag out of range. 3 = nx out of range. 4 = kx out of range. 5 = x not strictly increasing. 6 = tx not non-decreasing. 7 = ny out of range. 8 = ky out of range. 9 = y not strictly increasing. 10 = ty not non-decreasing. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | xval | x coordinate of evaluation point. |
||
real(kind=wp), | intent(in) | :: | yval | y coordinate of evaluation point. |
||
integer, | intent(in) | :: | idx | x derivative of piecewise polynomial to evaluate. |
||
integer, | intent(in) | :: | idy | y derivative of piecewise polynomial to evaluate. |
||
real(kind=wp), | intent(in), | dimension(nx+kx) | :: | tx | sequence of knots defining the piecewise polynomial in the x direction. (same as in last call to db2ink) |
|
real(kind=wp), | intent(in), | dimension(ny+ky) | :: | ty | sequence of knots defining the piecewise polynomial in the y direction. (same as in last call to db2ink) |
|
integer, | intent(in) | :: | nx | the number of interpolation points in x. (same as in last call to db2ink) |
||
integer, | intent(in) | :: | ny | the number of interpolation points in y. (same as in last call to db2ink) |
||
integer, | intent(in) | :: | kx | order of polynomial pieces in x. (same as in last call to db2ink) |
||
integer, | intent(in) | :: | ky | order of polynomial pieces in y. (same as in last call to db2ink) |
||
real(kind=wp), | intent(in), | dimension(nx,ny) | :: | bcoef | the b-spline coefficients computed by db2ink. |
|
real(kind=wp), | intent(out) | :: | f | interpolated value |
||
integer, | intent(out) | :: | iflag | status flag: 0 : no errors, /=0 : error |
||
integer, | intent(inout) | :: | inbvx | initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user. |
||
integer, | intent(inout) | :: | inbvy | initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user. |
||
integer, | intent(inout) | :: | iloy | initialization parameter which must be set to 1 the first time this routine is called, and must not be changed by the user. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | routine | |||
integer, | intent(inout) | :: | iflag | |||
integer, | intent(in), | optional | :: | nx | ||
integer, | intent(in), | optional | :: | ny | ||
integer, | intent(in), | optional | :: | nz | ||
integer, | intent(in), | optional | :: | nq | ||
integer, | intent(in), | optional | :: | nr | ||
integer, | intent(in), | optional | :: | ns | ||
integer, | intent(in), | optional | :: | kx | ||
integer, | intent(in), | optional | :: | ky | ||
integer, | intent(in), | optional | :: | kz | ||
integer, | intent(in), | optional | :: | kq | ||
integer, | intent(in), | optional | :: | kr | ||
integer, | intent(in), | optional | :: | ks | ||
real(kind=wp), | intent(in), | optional | dimension(:) | :: | x | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | y | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | z | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | q | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | r | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | s | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | tx | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | ty | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | tz | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | tq | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | tr | |
real(kind=wp), | intent(in), | optional | dimension(:) | :: | ts | |
logical, | intent(out) | :: | status_ok |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(n) | :: | x | ||
integer, | intent(in) | :: | n | |||
integer, | intent(in) | :: | k | |||
real(kind=wp), | intent(out), | dimension(:) | :: | t |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp) | :: | x(n) | ||||
integer, | intent(in) | :: | n | |||
real(kind=wp) | :: | fcn(ldf,nf) | ||||
integer, | intent(in) | :: | ldf | |||
integer, | intent(in) | :: | nf | |||
real(kind=wp) | :: | t(*) | ||||
integer, | intent(in) | :: | k | |||
real(kind=wp) | :: | bcoef(nf,n) | ||||
real(kind=wp) | :: | work(*) | ||||
integer, | intent(out) | :: | iflag |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(n) | :: | x | vector of length n containing data point abscissa in strictly increasing order. |
|
real(kind=wp), | intent(in), | dimension(n) | :: | y | corresponding vector of length n containing data point ordinates. |
|
real(kind=wp), | intent(in), | dimension(*) | :: | t | knot vector of length n+k since t(1),..,t(k) <= x(1) and t(n+1),..,t(n+k) |
|
integer, | intent(in) | :: | n | number of data points, n >= k |
||
integer, | intent(in) | :: | k | order of the spline, k >= 1 |
||
real(kind=wp), | intent(out), | dimension(n) | :: | bcoef | a vector of length n containing the b-spline coefficients |
|
real(kind=wp), | intent(out), | dimension(*) | :: | q | a work vector of length (2k-1)n, containing the triangular factorization of the coefficient matrix of the linear system being solved. the coefficients for the interpolant of an additional data set (x(i),yy(i)), i=1,…,n with the same abscissa can be obtained by loading yy into bcoef and then executing call dbnslv(q,2k-1,n,k-1,k-1,bcoef) |
|
real(kind=wp), | intent(out), | dimension(*) | :: | work | work vector of length 2*k |
|
integer, | intent(out) | :: | iflag | corresponding basis function and the system is singular. 104: the system of solver detects a singular system. although the theoretical conditions for a solution were satisfied. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(inout), | dimension(nroww,nrow) | :: | w | work array. See header for details. |
|
integer, | intent(in) | :: | nroww | row dimension of the work array w. must be >= nbandl + 1 + nbandu. |
||
integer, | intent(in) | :: | nrow | matrix order |
||
integer, | intent(in) | :: | nbandl | number of bands of a below the main diagonal |
||
integer, | intent(in) | :: | nbandu | number of bands of a above the main diagonal |
||
integer, | intent(out) | :: | iflag | indicating success(=1) or failure (=2) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(nroww,nrow) | :: | w | describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac. |
|
integer, | intent(in) | :: | nroww | describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac. |
||
integer, | intent(in) | :: | nrow | describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac. |
||
integer, | intent(in) | :: | nbandl | describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac. |
||
integer, | intent(in) | :: | nbandu | describes the lu-factorization of a banded matrix a of order nrow as constructed in dbnfac. |
||
real(kind=wp), | intent(inout), | dimension(nrow) | :: | b | in: right side of the system to be solved out: the solution x, of order nrow |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | t(*) | knot vector of length n+k, where n = number of b-spline basis functions n = sum of knot multiplicities-k dimension t(ileft+jhigh) |
||
integer, | intent(in) | :: | jhigh | order of b-spline, 1 <= jhigh <= k |
||
integer, | intent(in) | :: | k | highest possible order |
||
integer, | intent(in) | :: | index | index = 1 gives basis functions of order jhigh = 2 denotes previous entry with work, iwork values saved for subsequent calls to dbspvn. |
||
real(kind=wp), | intent(in) | :: | x | argument of basis functions, t(k) <= x <= t(n+1) |
||
integer, | intent(in) | :: | ileft | largest integer such that t(ileft) <= x < t(ileft+1) |
||
real(kind=wp), | intent(out) | :: | vnikx(k) | vector of length k for spline values. |
||
real(kind=wp), | intent(out) | :: | work(*) | a work vector of length 2*k |
||
integer, | intent(out) | :: | iwork | a work parameter. both work and iwork contain information necessary to continue for index = 2. when index = 1 exclusively, these are scratch variables and can be used for other purposes. |
||
integer, | intent(out) | :: | iflag |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in), | dimension(lxt) | :: | XT | a knot or break point vector of length lxt |
|
integer, | intent(in) | :: | lxt | length of the XT vector |
||
real(kind=wp), | intent(in) | :: | x | argument |
||
integer, | intent(inout) | :: | ilo | an initialization parameter which must be set to 1 the first time the spline array XT is processed by dintrv. ilo contains information for efficient processing after the initial call and ilo must not be changed by the user. distinct splines require distinct ilo parameters. |
||
integer, | intent(out) | :: | ileft | largest integer satisfying XT(ileft) <= x |
||
integer, | intent(out) | :: | mflag | signals when x lies out of bounds |