Multiple-output version of db1val: evaluates all nf outputs
of a spline from db1ink (multiple-output version) at one point.
The interval search and the basis functions in each direction are
only computed once, for all of the outputs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | xval |
coordinate of evaluation point. |
||
| integer(kind=ip), | intent(in) | :: | idx |
derivative of piecewise polynomial to evaluate. |
||
| real(kind=wp), | intent(in), | dimension(nx+kx) | :: | tx |
knots in the direction. |
|
| integer(kind=ip), | intent(in) | :: | nx |
the number of interpolation points in . |
||
| integer(kind=ip), | intent(in) | :: | kx |
order of polynomial pieces in . |
||
| real(kind=wp), | intent(in), | dimension(:,:) | :: | bcoef |
|
|
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
|
|
| integer(kind=ip), | intent(out) | :: | iflag |
status flag:
|
||
| integer(kind=ip), | 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. |
||
| logical, | intent(in), | optional | :: | extrap |
if extrapolation is allowed (if not present, default is False) |
pure subroutine db1val_multi(xval,idx,tx,nx,kx,bcoef,f,iflag,inbvx,extrap) implicit none real(wp),intent(in) :: xval !! \(x\) coordinate of evaluation point. integer(ip),intent(in) :: idx !! \(x\) derivative of piecewise polynomial to evaluate. integer(ip),intent(in) :: nx !! the number of interpolation points in \(x\). integer(ip),intent(in) :: kx !! order of polynomial pieces in \(x\). real(wp),dimension(nx+kx),intent(in) :: tx !! knots in the \(x\) direction. real(wp),dimension(:,:),intent(in) :: bcoef !! `(nx,nf)` b-spline coefficients !! from [[db1ink]] (multiple-output version). real(wp),dimension(:),intent(out) :: f !! `(nf)` interpolated values of the outputs integer(ip),intent(out) :: iflag !! status flag: !! !! * \( = 0 \) : no errors !! * 6002: `size(f)` is not the number of outputs !! * 6004: the leading dimensions of `bcoef` are not `(nx)` !! * other \( \ne 0 \) : error (see [[db1val]]) integer(ip),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. logical,intent(in),optional :: extrap !! if extrapolation is allowed !! (if not present, default is False) integer(ip) :: leftx !! interval index in \(x\) integer(ip) :: ix !! coefficient offset in \(x\) real(wp),dimension(kx) :: bx !! basis function weights in \(x\) integer(ip) :: jf !! output index f = 0.0_wp if (size(f,kind=ip)/=size(bcoef,2,kind=ip)) then iflag = 6002_ip return end if if (size(bcoef,1,kind=ip)/=nx) then iflag = 6004_ip return end if iflag = check_value(xval,tx,1_ip,extrap); if (iflag/=0_ip) return ! interval and basis function weights in each direction (once for all outputs) call dbvalu_weights(tx,nx,kx,idx,xval,inbvx,leftx,bx,iflag,extrap) if (iflag/=0_ip) return ix = leftx - kx do jf = 1_ip, size(f,kind=ip) f(jf) = dot_product(bx,bcoef(ix+1_ip:leftx,jf)) end do end subroutine db1val_multi