Set a knot sequence for the B-spline representation of a PCH function with breakpoints X. All knots will be at least double. Endknots are set as:
Since this is subsidiary to dpchbs, which validates its input before calling, it is unnecessary for such validation to be done here.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n | |||
real(kind=wp), | intent(in) | :: | x(*) | |||
integer, | intent(in) | :: | knotyp | |||
real(kind=wp), | intent(out) | :: | t(*) |
subroutine dpchkt (n, x, knotyp, t) integer,intent(in) :: n integer,intent(in) :: knotyp real(wp),intent(in) :: x(*) real(wp),intent(out) :: t(*) integer :: j, k, ndim real(wp) :: hbeg, hend ! initialize. ndim = 2*n ! set interior knots. j = 1 do k = 1, n j = j + 2 t(j) = x(k) t(j+1) = t(j) end do ! assertion: at this point t(3),...,t(ndim+2) have been set and ! j=ndim+1. ! ! set end knots according to knotyp. hbeg = x(2) - x(1) hend = x(n) - x(n-1) select case (knotyp) case (1) ! extrapolate. t(2) = x(1) - hbeg t(ndim+3) = x(n) + hend case (2) ! periodic. t(2) = x(1) - hend t(ndim+3) = x(n) + hbeg case default ! quadruple end knots. t(2) = x(1) t(ndim+3) = x(n) end select t(1) = t(2) t(ndim+4) = t(ndim+3) end subroutine dpchkt