30 #if defined(__cpp_lib_math_special_functions) || !defined(NUMCPP_NO_USE_BOOST)
37 #ifdef __cpp_lib_math_special_functions
40 #include "boost/math/special_functions/legendre.hpp"
57 template<
typename dtype>
62 if (x < -1.0 || x > 1.0 )
67 #ifdef __cpp_lib_math_special_functions
68 return std::legendre(n,
static_cast<double>(x));
85 template<
typename dtype>
90 if (x < -1.0 || x > 1.0 )
95 #ifdef __cpp_lib_math_special_functions
97 auto value = std::assoc_legendre(n, m,
static_cast<double>(x));
100 #if __GNUC__ != 7 && __GNUC__ != 8
103 value *= n % 2 == 0 ? 1 : -1;
109 #if __clang_major__ != 7 && __clang_major__ != 8
112 value *= n % 2 == 0 ? 1 : -1;
119 value *= n % 2 == 0 ? 1 : -1;
142 template<
typename dtype>
147 const auto function = [n](dtype x) ->
double
168 template<
typename dtype>
173 const auto function = [m, n](dtype x) ->
double
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1216
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4283
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1524
iterator begin() noexcept
Definition: NdArrayCore.hpp:1166
double legendre_p(uint32 n, dtype x)
Definition: legendre_p.hpp:58
NdArray< double > legendre_p(uint32 m, uint32 n, const NdArray< dtype > &inArrayX)
Definition: legendre_p.hpp:169
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
Definition: Coordinate.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40