Skip to main content

LegendreEval

Evaluate Legendre polynomials of order n at single or several points.

Interface 1

INTERFACE
MODULE PURE FUNCTION LegendreEval(n, x) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of polynomial
REAL(DFP), INTENT(IN) :: x
!! point of evaluation, it should be between -1 and 1
REAL(DFP) :: ans
!! Evaluate Legendre polynomial of order n at point x
END FUNCTION LegendreEval
END INTERFACE

Interface 2

INTERFACE
MODULE PURE FUNCTION LegendreEval(n, x) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: n
!! order of polynomial
REAL(DFP), INTENT(IN) :: x(:)
!! several points of evaluation
REAL(DFP) :: ans(SIZE(x))
!! Evaluate Legendre polynomial of order n at points x
END FUNCTION LegendreEval
END INTERFACE