 |
NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Go to the documentation of this file.
30 #if defined(__cpp_lib_math_special_functions) || !defined(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;
107 #endif // #if __GNUC__ != 7 && __GNUC__ != 8
108 #endif // #ifdef __GNUC__
111 #if __clang_major__ != 7 && __clang_major__ != 8
114 value *= n % 2 == 0 ? 1 : -1;
116 #endif // #if __clang_major__ != 6 && __clang_major__ != 7 && __clang_major__ != 8
117 #endif // #ifdef __clang__
121 value *= n % 2 == 0 ? 1 : -1;
123 #endif // #ifdef _MSC_VER
127 #else // #ifdef __cpp_lib_math_special_functions
131 #endif // #ifdef __cpp_lib_math_special_functions
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
189 #endif // #if defined(__cpp_lib_math_special_functions) || !defined(NO_USE_BOOST)
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4356
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
std::uint32_t uint32
Definition: Types.hpp:40
NdArray< double > legendre_p(uint32 m, uint32 n, const NdArray< dtype > &inArrayX)
Definition: legendre_p.hpp:173
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1487
Definition: Coordinate.hpp:44
double legendre_p(uint32 n, dtype x)
Definition: legendre_p.hpp:59
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1143
iterator begin() noexcept
Definition: NdArrayCore.hpp:1087