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"
58 template<
typename dtype>
63 if (x < -1.0 || x > 1.0 )
68 #ifdef __cpp_lib_math_special_functions
69 return std::legendre(n,
static_cast<double>(x));
87 template<
typename dtype>
92 if (x < -1.0 || x > 1.0 )
97 #ifdef __cpp_lib_math_special_functions
99 auto value = std::assoc_legendre(n, m,
static_cast<double>(x));
102 #if __GNUC__ != 7 && __GNUC__ != 8
105 value *= n % 2 == 0 ? 1 : -1;
111 #if __clang_major__ != 7 && __clang_major__ != 8
114 value *= n % 2 == 0 ? 1 : -1;
121 value *= n % 2 == 0 ? 1 : -1;
145 template<
typename dtype>
150 const auto function = [n](dtype x) ->
double
172 template<
typename dtype>
177 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
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1270
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4483
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1614
iterator begin() noexcept
Definition: NdArrayCore.hpp:1214
double legendre_p(uint32 n, dtype x)
Definition: legendre_p.hpp:59
NdArray< double > legendre_p(uint32 m, uint32 n, const NdArray< dtype > &inArrayX)
Definition: legendre_p.hpp:173
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