Defines a type meant for performing Hermite-type interpolation. The interpolating polynomial constructed by this object is a global polynomial, not a piecewise polynomial. Given N data points, the polynoial will be of degree 2 * N - 1. As N increases, the interpolating polynomial may be liable to oscillations that do not properly represent the data. For large data sets, a piecewise polynomial approach is recommended. See either the polynomial_interpolator or spline_interpolator types.
This implementation is a modification of the HERMITE library which can be found here.
Initializes the interpolation object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hermite_interpolator), | intent(inout) | :: | this |
The hermite_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. |
|
| real(kind=real64), | intent(in), | dimension(:) | :: | yp |
An N-element array containing the first derivative of the data. |
|
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
Performs the interpolation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hermite_interpolator), | intent(inout) | :: | this |
The hermite_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. |
Interpolates a single value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hermite_interpolator), | intent(inout) | :: | this |
The hermite_interpolator object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value at which to compute the interpolation. |
The interpolated value.
Performs the interpolation.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(hermite_interpolator), | intent(inout) | :: | this |
The hermite_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. |
|
| real(kind=real64), | intent(out), | optional, | dimension(:) | :: | ypi |
An N-element array containing the interpolated first derivative data, if supplied. |
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |