NumCpp  2.9.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
chebyshev_u.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #ifndef NUMCPP_NO_USE_BOOST
31 
32 #include "boost/math/special_functions/chebyshev.hpp"
33 
36 #include "NumCpp/NdArray.hpp"
37 
38 namespace nc
39 {
40  namespace polynomial
41  {
42  //============================================================================
43  // Method Description:
51  template<typename dtype>
52  double chebyshev_u(uint32 n, dtype x)
53  {
55 
56  return boost::math::chebyshev_u(n, static_cast<double>(x));
57  }
58 
59  //============================================================================
60  // Method Description:
68  template<typename dtype>
70  {
71  NdArray<double> returnArray(inArrayX.shape());
72 
73  const auto function = [n](dtype x) -> double { return chebyshev_u(n, x); };
74 
75  stl_algorithms::transform(inArrayX.cbegin(), inArrayX.cend(), returnArray.begin(), function);
76 
77  return returnArray;
78  }
79  } // namespace polynomial
80 } // namespace nc
81 
82 #endif // #ifndef NUMCPP_NO_USE_BOOST
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1221
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4092
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1529
iterator begin() noexcept
Definition: NdArrayCore.hpp:1171
double chebyshev_u(uint32 n, dtype x)
Definition: chebyshev_u.hpp:52
NdArray< double > chebyshev_u(uint32 n, const NdArray< dtype > &inArrayX)
Definition: chebyshev_u.hpp:69
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:784
Definition: Coordinate.hpp:45
std::uint32_t uint32
Definition: Types.hpp:40