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>
60 if (x < -1. || x > 1.)
65#ifdef __cpp_lib_math_special_functions
66 return std::legendre(n,
static_cast<double>(x));
83 template<
typename dtype>
88 if (x < -1. || x > 1.)
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;
140 template<
typename dtype>
145 const auto function = [n](dtype x) ->
double {
return legendre_p(n, x); };
163 template<
typename dtype>
168 const auto function = [m, n](dtype x) ->
double {
return legendre_p(m, n, x); };
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1365
const Shape & shape() const noexcept
Definition: NdArrayCore.hpp:4511
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1673
iterator begin() noexcept
Definition: NdArrayCore.hpp:1315
Definition: chebyshev_t.hpp:39
double legendre_p(uint32 n, dtype x)
Definition: legendre_p.hpp:56
NdArray< double > legendre_p(uint32 m, uint32 n, const NdArray< dtype > &inArrayX)
Definition: legendre_p.hpp:164
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:775
std::uint32_t uint32
Definition: Types.hpp:40