NumCpp  2.3.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 
31 #include "NumCpp/NdArray.hpp"
32 
33 #include "boost/math/special_functions/hankel.hpp"
34 
35 #include <complex>
36 #include <type_traits>
37 
38 namespace nc
39 {
40  namespace special
41  {
42  //============================================================================
43  // Method Description:
51  template<typename dtype1, typename dtype2>
52  auto spherical_hankel_1(dtype1 inV, dtype2 inX)
53  {
56 
57  return boost::math::sph_hankel_1(inV, inX);
58  }
59 
60  //============================================================================
61  // Method Description:
69  template<typename dtype1, typename dtype2>
70  auto spherical_hankel_1(dtype1 inV, const NdArray<dtype2>& inArray)
71  {
72  NdArray<decltype(spherical_hankel_1(dtype1{0}, dtype2{0}))> returnArray(inArray.shape());
73 
74  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
75  [inV](dtype2 inValue) -> auto
76  {
77  return spherical_hankel_1(inV, inValue);
78  });
79 
80  return returnArray;
81  }
82  } // namespace special
83 } // namespace nc
StaticAsserts.hpp
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4311
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:52
nc::NdArray
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:74
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:1490
nc
Definition: Coordinate.hpp:44
nc::NdArray::cbegin
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1146
nc::NdArray::begin
iterator begin() noexcept
Definition: NdArrayCore.hpp:1090