32#if defined(__cpp_lib_math_special_functions) || !defined(NUMCPP_NO_USE_BOOST)
39#ifndef __cpp_lib_math_special_functions
40#include "boost/math/special_functions/legendre.hpp"
55 template<
typename dtype>
65#ifdef __cpp_lib_math_special_functions
66 return std::legendre(
n,
static_cast<double>(x));
68 return boost::math::legendre_p(
n,
static_cast<double>(x));
83 template<
typename dtype>
93#ifdef __cpp_lib_math_special_functions
95 auto value = std::assoc_legendre(
n,
m,
static_cast<double>(x));
98#if __GNUC__ != 7 && __GNUC__ != 8
101 value *=
n % 2 == 0 ? 1 : -1;
107#if __clang_major__ != 7 && __clang_major__ != 8
110 value *=
n % 2 == 0 ? 1 : -1;
117 value *=
n % 2 == 0 ? 1 : -1;
125 return boost::math::legendre_p(
n,
m,
static_cast<double>(x));
140 template<
typename dtype>
163 template<
typename dtype>
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition StaticAsserts.hpp:39
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
Definition chebyshev_t.hpp:39
double legendre_p(uint32 n, dtype x)
Definition legendre_p.hpp:56
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition StlAlgorithms.hpp:775
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
std::uint32_t uint32
Definition Types.hpp:40