NumCpp  2.14.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
hermite.hpp
Go to the documentation of this file.
1
28#pragma once
29
30#include <cmath>
31
32#if defined(__cpp_lib_math_special_functions) || !defined(NUMCPP_NO_USE_BOOST)
33
36#include "NumCpp/NdArray.hpp"
37
38#ifndef __cpp_lib_math_special_functions
39#include "boost/math/special_functions/hermite.hpp"
40#endif
41
42namespace nc::polynomial
43{
44 //============================================================================
45 // Method Description:
54 template<typename dtype>
55 double hermite(uint32 n, dtype x)
56 {
58
59#ifdef __cpp_lib_math_special_functions
60 return std::hermite(n, static_cast<double>(x));
61#else
62 return boost::math::hermite(n, static_cast<double>(x));
63#endif
64 }
65
66 //============================================================================
67 // Method Description:
76 template<typename dtype>
78 {
80
81 const auto function = [n](dtype x) -> double { return hermite(n, x); };
82
84
85 return returnArray;
86 }
87} // namespace nc::polynomial
88
89#endif // #if defined(__cpp_lib_math_special_functions) || !defined(NUMCPP_NO_USE_BOOST)
#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 hermite(uint32 n, dtype x)
Definition hermite.hpp:55
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