Multiple-output version of db1ink: interpolates nf functions
on the same grid, with the same knots. The last dimension of fcn
and bcoef is the output index. Evaluate them with db1val
(multiple-output version).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(:) | :: | x |
|
|
| integer(kind=ip), | intent(in) | :: | nx |
Number of abcissae |
||
| real(kind=wp), | intent(in), | dimension(:,:) | :: | fcn |
|
|
| integer(kind=ip), | intent(in) | :: | kx |
The order of spline pieces in |
||
| integer(kind=ip), | intent(in) | :: | iknot |
knot sequence flag (see db1ink_default) |
||
| real(kind=wp), | intent(inout), | dimension(:) | :: | tx |
The |
|
| real(kind=wp), | intent(out), | dimension(:,:) | :: | bcoef |
|
|
| integer(kind=ip), | intent(out) | :: | iflag |
status flag (see db1ink_default),
or 6001 if |
pure subroutine db1ink_multi(x,nx,fcn,kx,iknot,tx,bcoef,iflag) implicit none integer(ip),intent(in) :: nx !! Number of \(x\) abcissae integer(ip),intent(in) :: kx !! The order of spline pieces in \(x\) real(wp),dimension(:),intent(in) :: x !! `(nx)` array of \(x\) abcissae. Must be strictly increasing. real(wp),dimension(:,:),intent(in) :: fcn !! `(nx,nf)` array of function values to interpolate: !! `fcn(i1,j)` is output `j` at grid point !! (`x(i1)`) integer(ip),intent(in) :: iknot !! knot sequence flag (see [[db1ink_default]]) real(wp),dimension(:),intent(inout) :: tx !! The `(nx+kx)` knots in the \(x\) direction real(wp),dimension(:,:),intent(out) :: bcoef !! `(nx,nf)` array of b-spline coefficients integer(ip),intent(out) :: iflag !! status flag (see [[db1ink_default]]), !! or 6001 if `fcn` and `bcoef` do not have the !! same number of outputs (or it is zero) integer(ip) :: nf !! number of outputs integer(ip) :: j !! output index nf = size(fcn,2,kind=ip) if (nf<1_ip .or. size(bcoef,2,kind=ip)/=nf) then iflag = 6001_ip return end if ! the knots are computed (if iknot=0) for the first output, and then reused do j = 1_ip, nf call db1ink_default(x,nx,fcn(:,j),kx,merge(iknot,1_ip,j==1_ip),& tx,bcoef(:,j),iflag) if (iflag/=0_ip) return end do end subroutine db1ink_multi