Check the knots and coefficients for one direction in the
initialize_from_coefficients methods.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ip), | intent(in) | :: | n |
number of b-spline coefficients |
||
| integer(kind=ip), | intent(in) | :: | k |
order of the b-spline |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | t |
knot vector |
|
| integer(kind=ip), | intent(out) | :: | iflag |
status flag (0 if everything is OK) |
pure subroutine check_coefficients(n,k,t,iflag) implicit none integer(ip),intent(in) :: n !! number of b-spline coefficients integer(ip),intent(in) :: k !! order of the b-spline real(wp),dimension(:),intent(in) :: t !! knot vector integer(ip),intent(out) :: iflag !! status flag (0 if everything is OK) integer(ip) :: nt !! number of knots nt = size(t,kind=ip) if (k<1_ip) then iflag = 5001_ip else if (n<k) then iflag = 5002_ip else if (nt/=n+k) then iflag = 5003_ip else if (any(t(2_ip:nt)<t(1_ip:nt-1_ip))) then iflag = 5004_ip else if (t(k)>=t(n+1_ip)) then iflag = 5005_ip else iflag = 0_ip end if end subroutine check_coefficients