linear_interpolator Derived Type

type, public, extends(base_interpolator) :: linear_interpolator

Defines a type meant for performing piecewise linear interpolation.


Contents


Type-Bound Procedures

procedure, public :: initialize => li_init

  • private subroutine li_init(this, x, y, err)

    Initializes the interpolation object.

    Arguments

    Type IntentOptional Attributes Name
    class(linear_interpolator), intent(inout) :: this

    The linear_interpolator object.

    real(kind=real64), intent(in), dimension(:) :: x

    An N-element array containing the x-coordinate data in either monotonically increasing or decreasing order.

    real(kind=real64), intent(in), dimension(:) :: y

    An N-element array containing the y-coordinate data.

    class(errors), intent(inout), optional, target :: err

    An error handling object.

procedure, public :: interpolate => bi_interp

  • private subroutine bi_interp(this, x, yi, err)

    Performs the interpolation.

    Arguments

    Type IntentOptional Attributes Name
    class(base_interpolator), intent(inout) :: this

    The base_interpolator object.

    real(kind=real64), intent(in), dimension(:) :: x

    An N-element array containing the x values at which to compute the interpolation.

    real(kind=real64), intent(out), dimension(:) :: yi

    An N-element array containing the interpolated data.

    class(errors), intent(inout), optional, target :: err

    An error handling object.

procedure, public :: interpolate_value => li_raw_interp

  • private function li_raw_interp(this, x) result(rst)

    Interpolates a single value.

    Arguments

    Type IntentOptional Attributes Name
    class(linear_interpolator), intent(inout) :: this

    The linear_interpolator object.

    real(kind=real64), intent(in) :: x

    The value at which to compute the interpolation.

    Return Value real(kind=real64)

    The interpolated value.