NumCpp  2.1.0
A C++ implementation of the Python Numpy library
spherical_hankel_2.hpp
Go to the documentation of this file.
1 #pragma once
30 
32 #include "NumCpp/NdArray.hpp"
33 
34 #include "boost/math/special_functions/hankel.hpp"
35 
36 #include <complex>
37 #include <type_traits>
38 
39 namespace nc
40 {
41  namespace special
42  {
43  //============================================================================
44  // Method Description:
52  template<typename dtype1, typename dtype2>
53  std::complex<double> spherical_hankel_2(dtype1 inV, dtype2 inX)
54  {
57 
58  return boost::math::sph_hankel_2(inV, inX);
59  }
60 
61  //============================================================================
62  // Method Description:
70  template<typename dtype1, typename dtype2>
71  auto spherical_hankel_2(dtype1 inV, const NdArray<dtype2>& inArray)
72  {
73  NdArray<decltype(spherical_hankel_2(dtype1{0}, dtype2{0}))> returnArray(inArray.shape());
74 
75  stl_algorithms::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
76  [inV](dtype2 inValue) -> auto
77  {
78  return spherical_hankel_2(inV, inValue);
79  });
80 
81  return returnArray;
82  }
83  } // namespace special
84 } // namespace nc
StaticAsserts.hpp
nc::NdArray::shape
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4312
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
nc::special::spherical_hankel_2
std::complex< double > spherical_hankel_2(dtype1 inV, dtype2 inX)
Definition: spherical_hankel_2.hpp:53
nc::NdArray
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:75
nc::stl_algorithms::transform
OutputIt transform(InputIt first, InputIt last, OutputIt destination, UnaryOperation unaryFunction)
Definition: StlAlgorithms.hpp:703
NdArray.hpp
nc::NdArray::cend
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1491
nc
Definition: Coordinate.hpp:45
nc::NdArray::cbegin
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1147
nc::NdArray::begin
iterator begin() noexcept
Definition: NdArrayCore.hpp:1091