control_points_1d Subroutine

private pure subroutine control_points_1d(me, x, y, iflag)

The control points of a bspline_1d: the Greville abscissae (see greville_abscissae) and the b-spline coefficients.

The spline lies within the convex hull of its control points, and the control polygon (the control points joined by straight lines) approximates the spline.

Type Bound

bspline_1d

Arguments

Type IntentOptional Attributes Name
class(bspline_1d), intent(inout) :: me
real(kind=wp), intent(out), dimension(:), allocatable :: x

(nx) locations of the control points (the Greville abscissae)

real(kind=wp), intent(out), dimension(:), allocatable :: y

(nx) values of the control points (the b-spline coefficients)

integer(kind=ip), intent(out) :: iflag

status flag: 0 if no errors, 1 if the class is not initialized


Calls

proc~~control_points_1d~~CallsGraph proc~control_points_1d bspline_1d%control_points_1d proc~greville_abscissae greville_abscissae proc~control_points_1d->proc~greville_abscissae

Source Code

    pure subroutine control_points_1d(me,x,y,iflag)

    implicit none

    class(bspline_1d),intent(inout)               :: me
    real(wp),dimension(:),allocatable,intent(out) :: x      !! `(nx)` locations of the control points
                                                            !! (the Greville abscissae)
    real(wp),dimension(:),allocatable,intent(out) :: y      !! `(nx)` values of the control points
                                                            !! (the b-spline coefficients)
    integer(ip),intent(out)                       :: iflag  !! status flag: 0 if no errors,
                                                            !! 1 if the class is not initialized

    if (me%initialized .and. me%nf/=1_ip) then
        iflag = 6003_ip  ! use the multiple-output version
        allocate(x(0), y(0))
    else if (me%initialized) then
        allocate(x(me%nx))
        call greville_abscissae(me%tx,me%nx,me%kx,x)
        y = me%bcoef(:,1)
        iflag = 0_ip
    else
        allocate(x(0), y(0))
        iflag = 1_ip
    end if
    me%iflag = iflag

    end subroutine control_points_1d