lag_intrp Function

public function lag_intrp(n, x, w, f, p) result(res)

Evaluates the Lagrange interpolant (barycentric) at a given point p from nodal coordinates and nodal function values in 1D.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Number of interpolant nodes = n+1.

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

(n,). Nodal coordinates in strictly ascending order

real(kind=rp), intent(in), dimension(:) :: w

(n,). Barycentric weights

real(kind=rp), intent(in), dimension(:) :: f

(n,). Value of the function at the nodes

real(kind=rp), intent(in) :: p

Coordinate of the interpolation point.

Return Value real(kind=rp)