NumCpp  2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
spherical_hankel_1.hpp
Go to the documentation of this file.
1 #pragma once
29 
30 #ifndef NO_USE_BOOST
31 
33 #include "NumCpp/NdArray.hpp"
34 
35 #include "boost/math/special_functions/hankel.hpp"
36 
37 #include <complex>
38 #include <type_traits>
39 
40 namespace nc
41 {
42  namespace special
43  {
44  //============================================================================
45  // Method Description:
54  template<typename dtype1, typename dtype2>
55  auto spherical_hankel_1(dtype1 inV, dtype2 inX)
56  {
59 
60  return boost::math::sph_hankel_1(inV, inX);
61  }
62 
63  //============================================================================
64  // Method Description:
73  template<typename dtype1, typename dtype2>
74  auto spherical_hankel_1(dtype1 inV, const NdArray<dtype2>& inArray)
75  {
76  NdArray<decltype(spherical_hankel_1(dtype1{0}, dtype2{0}))> returnArray(inArray.shape());
77 
78  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
79  [inV](dtype2 inValue) -> auto
80  {
81  return spherical_hankel_1(inV, inValue);
82  });
83 
84  return returnArray;
85  }
86  } // namespace special
87 } // namespace nc
88 
89 #endif // #ifndef NO_USE_BOOST
StaticAsserts.hpp
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4356
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
nc::special::spherical_hankel_1
auto spherical_hankel_1(dtype1 inV, dtype2 inX)
Definition: spherical_hankel_1.hpp:55
nc::NdArray
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:71
nc::stl_algorithms::transform
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:702
NdArray.hpp
nc::NdArray::cend
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1487
nc
Definition: Coordinate.hpp:44
nc::NdArray::cbegin
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1143
nc::NdArray::begin
iterator begin() noexcept
Definition: NdArrayCore.hpp:1087