27 #ifndef mx_legendre_hpp
28 #define mx_legendre_hpp
30 #include <type_traits>
32 #ifdef MX_INCLUDE_BOOST
33 #include <boost/math/special_functions/legendre.hpp>
56 #ifdef MX_INCLUDE_BOOST
57 return boost::math::legendre_p<T>(n, x);
59 static_assert(std::is_fundamental<T>::value || !std::is_fundamental<T>::value,
"legendre_p<T> not specialized for type T, and MX_INCLUDE_BOOST is not defined, so I can't just use boost.");
65 float legendre_p<float>(
int n,
70 double legendre_p<double>(
int n,
75 long double legendre_p<long double>(
int n,
81 __float128 legendre_p<__float128>(
int n,
98 return sqrt((
static_cast<T
>(2*n+1))/
static_cast<T
>(2)) * legendre_p<T>(n,x);
T legendre_p(int n, T x)
Legendre Polynomials.
T orthoNormalLegendre(int n, T x)
The orthonormal Legendre polynomials.